本文整理汇总了Python中Dictionary.Dictionary.checkWord方法的典型用法代码示例。如果您正苦于以下问题:Python Dictionary.checkWord方法的具体用法?Python Dictionary.checkWord怎么用?Python Dictionary.checkWord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dictionary.Dictionary
的用法示例。
在下文中一共展示了Dictionary.checkWord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Dictionary
# 需要导入模块: from Dictionary import Dictionary [as 别名]
# 或者: from Dictionary.Dictionary import checkWord [as 别名]
import sys
from Dictionary import Dictionary
from Board import Board
if __name__ == '__main__':
path = "../Resources/esOptimized.txt"
dct = Dictionary()
end = False
dct.loadJSONFromPath(path)
if (len(sys.argv) == 1):
print 'System ready\n\n'
end = False
while not end:
word = raw_input('Word to check ')
print "The word \"" + word + "\" is " + "correct" if dct.checkWord(word) else "not correct"
if word == 'bye':
end = True
print "See you soon!"
else:
word = sys.argv[1]
if word == 'run':
board = Board()
board.setTestData()
move = board.findBestMove(dct, "hlo")
if move == None:
print "There are no moves :S"
else:
#print [x.__dict__ for x in move]
print "The best solution is ", move.__dict__
else: