Exemple #1
0
 def test_unigram(self):
     n = NGram(0)
     n.add('after')
     n.next_word() == 'after'
Exemple #2
0
 def test_trigram(self):
     n = NGram(2)
     n.add('after', ('before', 'other'))
     assert n.next_word(('before', 'other')) == 'after'
Exemple #3
0
 def test_bigram(self):
     n = NGram(1)
     n.add('after', ('before'))
     assert n.next_word(('before')) == 'after'
 def test_unigram(self):
     n = NGram(0)
     n.add('after')
     n.next_word() == 'after'
 def test_trigram(self):
     n = NGram(2)
     n.add('after', ('before', 'other'))
     assert n.next_word(('before', 'other')) == 'after'
 def test_bigram(self):
     n = NGram(1)
     n.add('after', ('before'))
     assert n.next_word(('before')) == 'after'