だから私はpython 2.7で英語のすべての単語をループして、英語の単語のモールス信号バージョンが未知のモールス語句と一致するかどうかを確認するプログラムを書いています。単純に解釈できないのは、文字間にスペースがないからです。これはコードのスニペットです:
def morse_solver(nol,morse,words):
#nol is the number of letters to cut down search time,morse is the Morse phrase to decode, and words is a string (or can be a list) of all english words.
lista=_index(words)
#_index is a procedure that organizes the input in the following way:[nol,[]]
selection=lista[nol-1][1]
#selects the words with that nol to loop through
for word in selection:
if morse_encode(word)==morse:
print morse+"="+word
私の質問は次
のとおりです。
英語のすべての単語のリストを見つけて、それを巨大な文字列にコピーするのはちょっと難しいです。では、少し入力するだけで英語辞書のすべての単語にアクセスする方法または Python モジュールはありますか?
そのようなものが存在しない場合、どうすればそのような大きな文字列を処理できますか? (1行だけに)コピーペーストできる場所はありますか?前もって感謝します