from morse_decrypt.dict import Dict
from morse_decrypt.morse_decrypt import MorseDecrypt
from morse_decrypt.word_guess import WordGuess

if __name__ == '__main__':
    morse_cipher = "..-..--..-......-"

    word_guess = WordGuess(
        Dict([
            "dict/wordlist-german.txt",
            "dict/wordlist-english.txt"
        ])
    )
    morse_decrypt = MorseDecrypt()
    char_guesses = morse_decrypt.guess_morse_text(morse_cipher)
    print("Chars guessed. char_guesses complete.")

    guess_list_length = len(char_guesses)
    for index, word in enumerate(char_guesses):
        print("(", index, "/", guess_list_length, ") - ", word, "...", end="")
        vocab_guesses = word_guess.guess_vocabs(word, '', [])
        print("\r", end="")
        if vocab_guesses:
            print("Found something: ", vocab_guesses)
