Grammalecte  Diff

Differences From Artifact [6a83d3b431]:

To Artifact [af51223cf8]:


39
40
41
42
43
44
45
46

47
48
49
50
51
52
53
54
55
56
57
    "returns True it can be a measurement unit"
    if _zUnitSpecial.search(s):
        return True
    if 1 < len(s) < 16 and s[0:1].islower() and (not s[1:].islower() or _zUnitNumbers.search(s)):
        return True
    return False

def queryNamesPOS(sWord1, sWord2):

    lMorph1 = _oSpellChecker.getMorph(sWord1)
    lMorph2 = _oSpellChecker.getMorph(sWord2)
    if not lMorph1 or not lMorph2:
        return ":N:e:p"
    sGender1 = cr.getGender(lMorph1)
    sGender2 = cr.getGender(lMorph2)
    if sGender1 == ":m" or sGender2 == ":m":
        return ":N:m:p"
    if sGender1 == ":f" or sGender2 == ":f":
        return ":N:f:p"
    return ":N:e:p"







|
>




|
|





39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    "returns True it can be a measurement unit"
    if _zUnitSpecial.search(s):
        return True
    if 1 < len(s) < 16 and s[0:1].islower() and (not s[1:].islower() or _zUnitNumbers.search(s)):
        return True
    return False

def queryNamesPOS (sWord1, sWord2):
    "returns POS tag for <sWord1> and <sWord2> as a whole"
    lMorph1 = _oSpellChecker.getMorph(sWord1)
    lMorph2 = _oSpellChecker.getMorph(sWord2)
    if not lMorph1 or not lMorph2:
        return ":N:e:p"
    sGender1, _ = cr.getGenderNumber(lMorph1)
    sGender2, _ = cr.getGenderNumber(lMorph2)
    if sGender1 == ":m" or sGender2 == ":m":
        return ":N:m:p"
    if sGender1 == ":f" or sGender2 == ":f":
        return ":N:f:p"
    return ":N:e:p"