Exemplo n.º 1
0
    def _load_docs(cls):
        test_dir = os.path.dirname(__file__)
        reuters_ldac_fn = os.path.join(test_dir, 'data', 'reuters.ldac')
        with open(reuters_ldac_fn, 'r') as f:
            cls.docs = utils.docs_from_ldac(f)

        cls.V = utils.num_terms(cls.docs)
        cls.N = len(cls.docs)
Exemplo n.º 2
0
    def _load_docs(cls):
        test_dir = os.path.dirname(__file__)
        reuters_ldac_fn = os.path.join(test_dir, 'data', 'reuters.ldac')
        with open(reuters_ldac_fn, 'r') as f:
            cls.docs = utils.docs_from_ldac(f)

        cls.V = utils.num_terms(cls.docs)
        cls.N = len(cls.docs)
Exemplo n.º 3
0
def test_num_terms():
    docs = [[0, 1, 2], [1, 2, 3]]
    assert utils.num_terms(docs) == 4
Exemplo n.º 4
0
def test_num_terms():
    docs = [[0, 1, 2], [1, 2, 3]]
    assert utils.num_terms(docs) == 4