def test_peek(): word = 'one' scaner = lexicon.scan('bear') assert_equal(parser.peek(word), 'o') assert_equal(parser.peek(scaner), 'noun') assert_equal(parser.peek(None), None)
def test_peek(): assert_equal(parser.peek([('direction', 'north')]), 'direction') assert_equal(parser.peek([('verb', 'go'), ('direction', 'north')]), 'verb') assert_equal( parser.peek([('stop', 'of'), ('number', 1234), ('noun', 'princess')]), 'stop') assert_equal(parser.peek([]), None)
def test_peek(): # test an empty word_list returns None word_list = () assert_equal(parser.peek(word_list), None) # test a none empty word_list returns the correct word word_list = [('verb', 'run'), ('noun', 'bear')] assert_equal(parser.peek(word_list), 'verb')
def test_peek(): word_list = [] assert None == parser.peek(word_list) word_list = [('noun', 'bear'), ('verb', 'go')] assert 'noun' == parser.peek(word_list) word_list = lexicon.scan('princess kill bear') assert 'noun' == parser.peek(word_list)
def test_peek(): assert_equal(parser.peek(lexicon.scan("north south east west")), "direction") assert_equal(parser.peek(lexicon.scan("NORTH south east west")), "direction") assert_equal(parser.peek(lexicon.scan("moo ias blargh")), 'error') #result = parser.peek(lexicon.scan("north, south, ")) result = parser.peek( lexicon.scan("north south east west up downn left right")) assert_equal(result, 'direction')
def test_peek(): test_list = [('noun', 'princess')] result = parser.peek(test_list) assert_equal(result, 'noun') test_list = [('verb', 'go'), ('noun', 'princess'), ('direction', 'east')] result = parser.peek(test_list) assert_equal(result, 'verb') test_list = [] result = parser.peek(test_list) assert_equal(result, None)
def test_peek(): assert_equal(parser.peek(word_list), word_type)
def test_peek(): assert_equal(parser.peek([('noun', 'princess')]), 'noun')
def test_peek(): assert_equal(parser.peek(testsentence), testsentence[0])
def testing_peek(): '''testing the peek function.''' word_list = lexicon.scan('bear') assert_equal(parser.peek(word_list), 'noun') assert_equal(parser.peek(None), None)
def test_peek(): assert_equal(parser.peek([]), None) # Empty List result = parser.peek([('verb', 'run'), ('direction', 'north')]) assert_equal(result, 'verb')
def test__peek(): words = [("direction", "north"), ("noun", "bear")] words2 = [("direction", "north"), ("noun", "bear")] word = parser.peek(words) assert_equal(("direction", "north"), word) assert_equal(words, words2)
def test_peek(): word_list = lexicon.scan("bear eat cake") assert_equal(parser.peek(word_list),"noun") assert_equal(parser.peek(None),None)
def test_peek(): # check peeking on empty word list, list with 1 item, list with many items assert_equal(parser.peek([]), None) assert_equal(parser.peek(lexicon.scan("north")), "direction") assert_equal(parser.peek(lexicon.scan("go north now")), "verb")
def test_peek(): word_list = [('noun', 'Dog'), ('verb', 'ran'), ('stop', 'to'), ('stop', 'the'), ('noun', 'cow')] assert_equal(parser.peek(word_list), 'noun')
def test_peek(): assert_equal(parser.peek([('direction', 'south'), ('direction', 'east')]), 'direction') assert_equal(parser.peek([]), None)
def test_peek(): word_list = lexicon.scan("open the door") assert_equal(parser.peek(word_list), "verb")
def test_peek(): word_list = lexicon2.scan('princess') #We need to compare this to the outcome of parser.peek assert_equal(parser.peek(word_list), 'noun')
def test_peek(): word_list = [] assert None == parser.peek(word_list) word_list = lexicon.scan("princess kill bear") assert "noun" == parser.peek(word_list)
def test_peek(): word_list = lexicon.scan('eat the bear bla') assert_equal(parser.peek(word_list), 'verb') assert_equal(parser.peek([]), None) assert_equal(parser.peek(None), None)
def test_peek(): assert_equal(parser.peek([('verb', 'kill')]), 'verb') assert_equal(None, None)
def test_peek(): wordlist = wordlist = [("verb", "kill"), ("stop", "the"), ("noun", "princess")] assert_equal(parser.peek(wordlist), "verb") assert_equal(parser.peek(""), None)
def TestPeek(): inputsent = lexicon.scan("bear eat castle") firstwordtype = parser.peek(inputsent) assert_equal(firstwordtype, "noun")
def test_peek(): test = [('noun', 'bear')] assert_equal(parser.peek(test), 'noun') assert_equal(parser.peek(None), None)
def test_peek(): word_list = lexicon.scan("princess") assert_equal(parser.peek(word_list), "noun") assert_equal(parser.peek(None), None)
def test_peek(): word_list = lexicon.scan('princess') assert_equal(parser.peek(word_list), 'noun') assert_equal(parser.peek(None), None)
def test_peek(): word_list = lexicon.scan("open the door") assert_equal(parser.peek(word_list), 'verb')
def test_peek(): x = parser.peek([("noun", "bear")]) assert_equal(x, "noun")