Exemplo n.º 1
0
 def test_unigram(self):
     n = NGram(0)
     n.add('after')
     n.next_word() == 'after'
Exemplo n.º 2
0
 def test_trigram(self):
     n = NGram(2)
     n.add('after', ('before', 'other'))
     assert n.next_word(('before', 'other')) == 'after'
Exemplo n.º 3
0
 def test_bigram(self):
     n = NGram(1)
     n.add('after', ('before'))
     assert n.next_word(('before')) == 'after'
Exemplo n.º 4
0
 def test_unigram(self):
     n = NGram(0)
     n.add('after')
     n.next_word() == 'after'
Exemplo n.º 5
0
 def test_trigram(self):
     n = NGram(2)
     n.add('after', ('before', 'other'))
     assert n.next_word(('before', 'other')) == 'after'
Exemplo n.º 6
0
 def test_bigram(self):
     n = NGram(1)
     n.add('after', ('before'))
     assert n.next_word(('before')) == 'after'