def load_dic(path): 
    """
    The format of word dictionary : each line is a word.
    Args: 
      Input path
    Returns: 
      load dict {k, v} = {term, id}
    """
    dic = {}
    with open(path) as f: 
        for id, line in enumerate(f): 
            w = line.strip()
            dic[w] = id
    return dic