import pickle


def load_word_array(filename):
    """
    Load integer word array and dictionary saved by save_word_array()
    :param filename: Same filename used with save_word_array()
    :return: 2-tuple
        0) Numpy word array of integers (document representation)
        1) Word -> int dictionary
    Note: no unit test coverage
    """
    with open(filename + '.p', 'rb') as f:
        word_array_dict = pickle.load(f)

    return word_array_dict['word_array'], word_array_dict['dictionary'], word_array_dict['num_lines'], \
           word_array_dict['num_words'], word_array_dict['num_unique_words']