Esempio n. 1
0
def test_insert_top_word_beyond_max():
    test_parser = Parser(input_file="fake.txt", rules_file="fake.txt")
    top_words = [("a", 4), ("b", 3)]
    test_parser.insert_top_word(3, top_words, 2, "c", 2)
    assert top_words == [("a", 4), ("b", 3)]
Esempio n. 2
0
def test_insert_top_word():
    test_parser = Parser(input_file="fake.txt", rules_file="fake.txt")
    top_words = [("a", 4), ("b", 3)]
    test_parser.insert_top_word(0, top_words, 5, "c", 5)
    assert top_words == [("c", 5), ("a", 4), ("b", 3)]