import codecs


def get_chemdner_gold_ann_set(goldann="CHEMDNER/CHEMDNER_TEST_ANNOTATION/chemdner_ann_test_13-09-13.txt"):
    """
    Load the CHEMDNER annotations to a set
    :param goldann: Path to CHEMDNER annotation file
    :return: Set of gold standard annotations
    """
    with codecs.open(goldann, 'r', 'utf-8') as goldfile:
            gold = goldfile.readlines()
    goldlist = []
    for line in gold:
        #pmid, T/A, start, end
        x = line.strip().split('\t')
        goldlist.append((x[0], x[1] + ":" + x[2] + ":" + x[3], '1'))
    #print goldlist[0:2]
    goldset = set(goldlist)
    return goldset, None