Пример #1
0
def listauthors(root):
    ''' parses xml with lxml objectify parser and calls 
        filter_authors to extract authors '''
    res = SimilaritySet(cutoff=CUTOFF)
    if root.algorithm is None:
        return res
    
    # the similarity_set callback to replace or remove special characters
    res.set_callback(replace)
    for alg in root.algorithm:
        # hibakezelesek, ha nem letezik a tag akkor ne is nezze
        if alg.find("variant") is not None and alg.variant.find("author") is not None:
            res.update(filter_authors(alg.variant.author))

    return res