私のdjangoアプリケーションでは、ユーザーはテキストボックスにいくつかの文字を入力し、文字に基づいて英語の辞書から一般的な単語を提供し、それをユーザーに提案する必要があります.
利用可能な一般的な英語辞書データベース、またはタスクを達成できる他のサイトからのある種のAPIはありますか
アナグラムを見つけることができるプログラムを探しているようです。これは非ジャンゴソリューションです。Joel が提案するように、/usr/share/dict/words を使用します。
from collections import defaultdict
def canonical_form(word):
return tuple(sorted(word))
anagrams = defaultdict(list)
for word in open("/usr/share/dict/words"):
word = word.lower().strip()
anagrams[canonical_form(word)].append(word)
while True:
print anagrams[canonical_form(raw_input())]