def read_tokenized_src_file(path, remove_eos=True):
    """
    read tokenized source text file and convert them to list of list of words
    :param path:
    :param remove_eos: concatenate the words in title and content
    :return: data, a 2d list, each item in the list is a list of words of a src text, len(data) = num_lines
    """
    data = []
    with open(path) as f:
        for line in f:
            if remove_eos:
                title_and_context = line.strip().split('<eos>')
                if len(title_and_context) == 1:  # it only has context without title
                    [context] = title_and_context
                    word_list = context.strip().split(' ')
                elif len(title_and_context) == 2:
                    [title, context] = title_and_context
                    word_list = title.strip().split(' ') + context.strip().split(' ')
                else:
                    raise ValueError("The source text contains more than one title")
            else:
                word_list = line.strip().split(' ')
            data.append(word_list)
    return data