'Compiles the dictionary from a list of words.
Arguments:
words -- a list of all unique words this vocabulary contains
output_file -- the path of the file this dictionary will
be written to'

def _compile_dictionary(self, words, output_file):

    self._logger.debug('Getting    phonemes    for    %d    words...', len(words))
    g2pconverter = PhonetisaurusG2P(**PhonetisaurusG2P.get_config())
    phonemes = g2pconverter.translate(words)
    self._logger.debug("Creating    dict    file:    '%s'", output_file)
    with open(output_file, 'w') as f:
        for (word, pronounciations) in phonemes.items():
            for (i, pronounciation) in enumerate(pronounciations, start=1):
                if (i == 1):
                    line = ('%s DCTB %s\n' % (word, pronounciation))
                else:
                    line = ('%s(%d) DCTB %s\n' % (word, i, pronounciation))
                f.write(line)
