def get_vocab(corpus_file, vocab_file, freq, vocab_size):
    if os.path.isfile(vocab_file):  # vocab_file exist
        (vocab_map, vocab_size) = load_vocab(vocab_file)
    else:
        (words, vocab_map, freq_map, vocab_size, num_train_words,
         num_lines) = load_vocab_from_corpus(corpus_file, freq, vocab_size)
        write_vocab(vocab_file, words)
    return (vocab_map, vocab_size)
Get FileReader instance.
dataset/ETHPy150Open yuhaozhang/nnjm-global/code/io_vocab.py/get_vocab--crossover with--dataset/ETHPy150Open openstack/compass-core/compass/log_analyzor/file_matcher.py/FileReaderFactory.get_file_reader