# Path: linguistica/util.py
# NULL = 'NULL'


from linguistica.util import NULL
def break_words(wordlist, break_dict):
    broken_words = dict()

    for i, this_word in enumerate(wordlist):
        broken_words[this_word] = list()
        break_list = sorted(break_dict[i])

        if not break_list:
            broken_words[this_word].append(this_word)
        else:
            this_piece = ''
            for x in range(len(this_word)):
                this_piece += this_word[x]
                if x + 1 in break_list:
                    broken_words[this_word].append(this_piece)
                    this_piece = ''
            if this_piece:
                broken_words[this_word].append(this_piece)

    return broken_words


def get_successors(wordlist, broken_words):
    successors = dict()
    for this_word in wordlist:
        this_word_parsed = broken_words[this_word]

        number_of_pieces = len(this_word_parsed)

        if not this_word_parsed:

# Path: linguistica/util.py
# NULL = 'NULL'


# Path: linguistica/trie.py
from linguistica.util import NULL

def break_words(wordlist, break_dict):
    broken_words = dict()

    for i, this_word in enumerate(wordlist):
        broken_words[this_word] = list()
        break_list = sorted(break_dict[i])

        if not break_list:
            broken_words[this_word].append(this_word)
        else:
            this_piece = ''
            for x in range(len(this_word)):
                this_piece += this_word[x]
                if x + 1 in break_list:
                    broken_words[this_word].append(this_piece)
                    this_piece = ''
            if this_piece:
                broken_words[this_word].append(this_piece)

    return broken_words


def get_successors(wordlist, broken_words):
    successors = dict()
    for this_word in wordlist:
        this_word_parsed = broken_words[this_word]

        number_of_pieces = len(this_word_parsed)

        if not this_word_parsed:

            successors[this_word] = {NULL}