def autoComplete(lemma1, etTag1, lemma2, etTag2, corpusWords):
    etAndTagToAdd = set()
    notFound = 0
    allRight1 = True
    allRight2 = True
    for (et, form) in etTag1.difference(etTag2):
        result = applyOnlyTree(lemma2, et)
        if (result == '#error#'):
            allRight = False
            break
        if ((result not in corpusWords) or (corpusWords[result] <= 3)):
            notFound += 1
            if (notFound == 2):
                allRight = False
                break
        else:
            etAndTagToAdd.add((et, form))
    if (allRight and etAndTagToAdd):
        if (lemma2 not in toAdd):
            toAdd[lemma2] = set()
        toAdd[lemma2] = toAdd[lemma2].union(etAndTagToAdd)
        for (et, form) in etAndTagToAdd:
            if ((lemma2, form) not in uniquenessCheck):
                uniquenessCheck[(lemma2, form)] = set()
            elif (applyOnlyTree(lemma2, et) not in uniquenessCheck[(lemma2, form)]):
                print('yeay')
            uniquenessCheck[(lemma2, form)].add(applyOnlyTree(lemma2, et))
def autoComplete(lemma1, etTag1, lemma2, etTag2, corpusWords):
    etAndTagToAdd = set()
    notFound = 0
    allRight1 = True
    allRight2 = True
    for (et, form) in etTag1.difference(etTag2):
        result = applyOnlyTree(lemma2, et)
        if (result == '#error#'):
            allRight = False
            break
        if ((result not in corpusWords) or (corpusWords[result] <= 3)):
            notFound += 1
            if (notFound == 2):
                allRight = False
                break
        else:
            etAndTagToAdd.add((et, form))
    if (allRight and etAndTagToAdd):
        if (lemma2 not in toAdd):
            toAdd[lemma2] = set()
        toAdd[lemma2] = toAdd[lemma2].union(etAndTagToAdd)
        for (et, form) in etAndTagToAdd:
            if ((lemma2, form) not in uniquenessCheck):
                uniquenessCheck[(lemma2, form)] = set()
            elif (applyOnlyTree(lemma2, et) not in uniquenessCheck[(lemma2, form)]):
                print('yeay')
            uniquenessCheck[(lemma2, form)].add(applyOnlyTree(lemma2, et))