def load_vocab(in_file):
    sos = VocabConstants.SOS
    eos = VocabConstants.EOS
    unk = VocabConstants.UNK

    # sys.stderr.write('# Loading vocab file %s ...\n' % in_file)
    vocab_inf = codecs.open(in_file, 'r', 'utf-8')
    words = []
    vocab_map = {}
    vocab_size = 0
    # add word, and update vocab_map based on the size count
    for line in vocab_inf:
        tokens = re.split('\s+', line.strip())
        word = tokens[0]
        words.append(word)
        vocab_map[word] = vocab_size
        vocab_size += 1

    # add sos, eos, unk
    for word in [sos, eos, unk]:
        (words, vocab_map, vocab_size) = add_word_to_vocab(
            word, words, vocab_map, vocab_size)
    vocab_inf.close()
    # sys.stderr.write('  num words = %d\n' % vocab_size)
    return (vocab_map, vocab_size)
Subclass and add stuff here to add entries to scheme_map
dataset/ETHPy150Open yuhaozhang/nnjm-global/code/io_vocab.py/load_vocab--crossover with--dataset/ETHPy150Open ardekantur/pyglet/tools/genmpkg/bdist_mpkg_pyglet/cmd_bdist_mpkg.py/bdist_mpkg.run_extra