示例#1
0
def test_read_from_url():
    model = LuminosoModel.make_empty(
        TEMPDIR + '/testdocs',
        {
            'num_concepts': 5,
            'num_axes': 2,
            'iteration': 0,
            'reader': 'simplenlp.en'
        }
    )
    model.learn_from_url(get_project_filename('test/TestDocuments'),
                         study=u'test')
    tags = model.database.get_document_tags(
      get_project_filename('test/TestDocuments/happytest.txt')
    )
    assert tags == [(u'study', u'test')]
    terms = model.get_document_terms(
      get_project_filename('test/TestDocuments/happytest.txt')
    )
    assert terms == [('happy', 1.0), ('sad', -0.5)]
示例#2
0
def test_filenames():
    assert os.access(get_project_filename('test/test_whereami.py'), os.F_OK)
    assert os.access(get_project_filename('setup.py'), os.F_OK)