Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'cleanupfiles' into develop

  • Loading branch information...
commit 8e9637340703b4704748048c1dfd009e7f8f66b2 2 parents 48be6e1 + c85ac5b
@piskvorky piskvorky authored
View
BIN  src/gensim/corpora/head500.noblanks.cor.bz2
Binary file not shown
View
2  src/gensim/corpora/tst.svmlight
@@ -1,2 +0,0 @@
-0 2:0.5
-0 1:1.0 2:2.0
View
BIN  src/gensim/corpora/tst.svmlight.index.db
Binary file not shown
View
3  src/gensim/test/test_corpora.py
@@ -20,6 +20,7 @@
module_path = os.path.dirname(__file__) # needed because sample data files are located in the same folder
+datapath = lambda fname: os.path.join(module_path, 'test_data', fname)
def testfile():
@@ -35,7 +36,7 @@ def __init__(self):
def testLoad(self):
- fname = os.path.join(module_path, 'testcorpus.' + self.fileExtension.lstrip('.'))
+ fname = datapath('testcorpus.' + self.fileExtension.lstrip('.'))
corpus = self.corpusClass(fname)
docs = list(corpus)
self.assertEqual(len(docs), 9) # the deerwester corpus always has nine documents, no matter what format
View
0  src/gensim/test/head500.noblanks.cor.bz2 → ...m/test/test_data/head500.noblanks.cor.bz2
File renamed without changes
View
0  src/gensim/test/miIslita.cor → src/gensim/test/test_data/miIslita.cor
File renamed without changes
View
0  src/gensim/test/testcorpus.blei → src/gensim/test/test_data/testcorpus.blei
File renamed without changes
View
0  src/gensim/test/testcorpus.blei.vocab → ...nsim/test/test_data/testcorpus.blei.vocab
File renamed without changes
View
0  src/gensim/test/testcorpus.low → src/gensim/test/test_data/testcorpus.low
File renamed without changes
View
0  src/gensim/test/testcorpus.mm → src/gensim/test/test_data/testcorpus.mm
File renamed without changes
View
0  src/gensim/test/testcorpus.svmlight → ...gensim/test/test_data/testcorpus.svmlight
File renamed without changes
View
7 src/gensim/test/test_miislita.py
@@ -23,6 +23,7 @@
# sample data files are located in the same folder
module_path = os.path.dirname(__file__)
+datapath = lambda fname: os.path.join(module_path, 'test_data', fname)
def get_tmpfile(suffix):
@@ -55,7 +56,7 @@ class TestMiislita(unittest.TestCase):
def test_textcorpus(self):
""" Make sure TextCorpus can be serialized to disk. """
# construct corpus from file
- fname = os.path.join(module_path, 'head500.noblanks.cor.bz2')
+ fname = datapath('head500.noblanks.cor.bz2')
miislita = CorpusMiislita(bz2.BZ2File(fname))
# make sure serializing works
@@ -74,7 +75,7 @@ def test_save_load_ability(self):
as the underlying input isn't a file-like object; we cannot pickle those).
"""
# construct corpus from file
- corpusname = os.path.join(module_path, 'miIslita.cor')
+ corpusname = datapath('miIslita.cor')
miislita = CorpusMiislita(corpusname)
# pickle to disk
@@ -89,7 +90,7 @@ def test_save_load_ability(self):
def test_miislita_high_level(self):
# construct corpus from file
- corpusname = os.path.join(module_path, 'miIslita.cor')
+ corpusname = datapath('miIslita.cor')
miislita = CorpusMiislita(corpusname)
# initialize tfidf transformation and similarity index
View
15 src/gensim/test/test_models.py
@@ -24,6 +24,7 @@
module_path = os.path.dirname(__file__) # needed because sample data files are located in the same folder
+datapath = lambda fname: os.path.join(module_path, 'test_data', fname)
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.WARNING)
@@ -49,7 +50,7 @@ def testfile():
class TestLsiModel(unittest.TestCase):
def setUp(self):
- self.corpus = mmcorpus.MmCorpus(os.path.join(module_path, 'testcorpus.mm'))
+ self.corpus = mmcorpus.MmCorpus(datapath('testcorpus.mm'))
def testTransform(self):
# create the transformation model
@@ -122,7 +123,7 @@ def testPersistence(self):
class TestRpModel(unittest.TestCase):
def setUp(self):
- self.corpus = mmcorpus.MmCorpus(os.path.join(module_path, 'testcorpus.mm'))
+ self.corpus = mmcorpus.MmCorpus(datapath('testcorpus.mm'))
def testTransform(self):
# create the transformation model
@@ -151,7 +152,7 @@ def testPersistence(self):
class TestLdaModel(unittest.TestCase):
def setUp(self):
- self.corpus = mmcorpus.MmCorpus(os.path.join(module_path, 'testcorpus.mm'))
+ self.corpus = mmcorpus.MmCorpus(datapath('testcorpus.mm'))
def testTransform(self):
passed = False
@@ -190,7 +191,7 @@ def testPersistence(self):
class TestTfidfModel(unittest.TestCase):
def setUp(self):
- self.corpus = mmcorpus.MmCorpus(os.path.join(module_path, 'testcorpus.mm'))
+ self.corpus = mmcorpus.MmCorpus(datapath('testcorpus.mm'))
def testTransform(self):
# create the transformation model
@@ -232,10 +233,8 @@ def testPersistence(self):
class TestLogEntropyModel(unittest.TestCase):
def setUp(self):
- self.corpus_small = mmcorpus.MmCorpus(os.path.join(module_path,
- 'test_data', 'test_corpus_small.mm'))
- self.corpus_ok = mmcorpus.MmCorpus(os.path.join(module_path,
- 'test_data', 'test_corpus_ok.mm'))
+ self.corpus_small = mmcorpus.MmCorpus(datapath('test_corpus_small.mm'))
+ self.corpus_ok = mmcorpus.MmCorpus(datapath('test_corpus_ok.mm'))
@raises(ValueError)
def test_corpus_validity(self):
Please sign in to comment.
Something went wrong with that request. Please try again.