Search an english word in a string without delimiters

You have to use a Trie data structure to find the English words in a string. You can use a dict, but Trie is memory efficient.

  1. Create a Trie with all English words.
  2. Here is an example (not tested):
string = "BONJOURHELLOCIAO"
for i in range(len(string)):  # start with first char
    current_word = ""
    for char in string[i:]:  # check all next chars
        current_word += char
        if trie.search(current_word):
            print(current_word)  # each iteration prints a word with the same base

        else:
            if not current_word:  # not a single word
                continue

            print(current_word)
            current_word = ""  # no more words with the same base