def test_generate_ngrams_creates_5_ngrams_list():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(4, len(output))
def test_first_4gram_is_i_am_testing_ngram():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(('i','am','testing','ngram'), output[4][0])
def test_second_3gram_is_i_am_testing_ngram():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(('am','testing','ngram'), output[3][1])
def test_generate_ngrams_creates_2_ngrams_of_length_4():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(2, len(output[4]))
def test_first_bigram_is_i_am():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(('i','am'), output[2][0])
def test_generate_ngrams_creates_4_ngrams_of_length_2():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(4, len(output[2]))
def test_generate_ngrams_creates_3_ngrams_of_length_3():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(3, len(output[3]))
Ejemplo n.º 8
0
def test_first_4gram_is_i_am_testing_ngram():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(('i', 'am', 'testing', 'ngram'), output[4][0])
Ejemplo n.º 9
0
def test_second_3gram_is_i_am_testing_ngram():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(('am', 'testing', 'ngram'), output[3][1])
Ejemplo n.º 10
0
def test_first_bigram_is_i_am():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(('i', 'am'), output[2][0])
Ejemplo n.º 11
0
def test_generate_ngrams_creates_2_ngrams_of_length_4():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(2, len(output[4]))
Ejemplo n.º 12
0
def test_generate_ngrams_creates_3_ngrams_of_length_3():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(3, len(output[3]))
Ejemplo n.º 13
0
def test_generate_ngrams_creates_4_ngrams_of_length_2():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(4, len(output[2]))
Ejemplo n.º 14
0
def test_generate_ngrams_creates_5_ngrams_list():
    input = "i am testing ngram generation"
    output = generate_ngrams(input)
    eq_(4, len(output))