Skip to content

Commit

Permalink
Fixes piskvorky#1401 , tests for phrasified sentences added
Browse files Browse the repository at this point in the history
  • Loading branch information
sj29-innovate committed Jan 31, 2018
1 parent dfdd16e commit 3d26f32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gensim/test/test_phrases.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ def testEmptyPhrasifiedSentencesIterator(self):
bigram_phraser = Phraser(bigram_phrases)
trigram_phrases = Phrases(bigram_phraser[self.sentences])
trigram_phraser = Phraser(trigram_phrases)
self.assertNotEqual(trigram_phraser[bigram_phraser[self.sentences]].__len__(), 0)
trigrams = trigram_phraser[bigram_phraser[self.sentences]]
fst, snd = list(trigrams), list(trigrams)
self.assertEqual(fst, snd)
self.assertNotEqual(snd, [])

def testEmptyInputsOnBigramConstruction(self):
"""Test that empty inputs don't throw errors and return the expected result."""
Expand Down

0 comments on commit 3d26f32

Please sign in to comment.