def read_analogies(filename, word2id):
    """
    Reads through the analogy question file.

    Returns:
      questions: a [n, 4] numpy array containing the analogy question's word ids.
      questions_skipped: questions skipped due to unknown words.
    """
    questions = []
    questions_skipped = 0
    with open(filename, 'r') as analogy_f:
        for line in analogy_f:
            if line.startswith(':'):  # Skip comments.
                continue
            words = line.strip().lower().split()
            ids = [w in word2id for w in words]
            if False in ids or len(ids) != 4:
                questions_skipped += 1
            else:
                questions.append(words)
    print('Eval analogy file: {}'.format(filename))
    print('Questions: {}'.format(len(questions)))
    print('Skipped: {}'.format(questions_skipped))
    return questions