Adds a phrase to a phrase dictionary.
        :param phrase: list of tokens
        :param phrase_id: phrase id
        :param dictionary: phrase dictionary
        :return: new phrase dictionary

def _add_phrase(cls, phrase, phrase_id, dictionary=None, word_list=None):
        """
        Adds a phrase to a phrase dictionary.
        :param phrase: list of tokens
        :param phrase_id: phrase id
        :param dictionary: phrase dictionary
        :return: new phrase dictionary
        """
        # @Note: this function is called recursively
        if dictionary is None:
            dictionary = {}
        if len(phrase):
            current_word = phrase[0]
            # if word_list is not None and current_word not in word_list: #@TODO remove, words should already be ids
            #     word_list.add(current_word)
            if current_word not in dictionary:
                dictionary[current_word] = {}
            cls._add_phrase(phrase[1:], phrase_id, dictionary[current_word], word_list)
        else:
            dictionary[None] = phrase_id
        return dictionary