Grammalecte  Check-in [f875f6c740]

Overview
Comment:[build][core] new sign for sentence tags: %
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core | build | rg
Files: files | file ages | folders
SHA3-256: f875f6c740c0167e25160ec4b332628df731135303505bbb164d792c9e47d462
User & Date: olr on 2018-07-19 08:51:12
Other Links: branch diff | manifest | tags
Context
2018-07-19
12:57
[fr] conversion: regex rules -> graph rules check-in: b6a4640bbb user: olr tags: fr, rg
08:51
[build][core] new sign for sentence tags: % check-in: f875f6c740 user: olr tags: core, build, rg
08:31
[core] semantic (token) tags check-in: 93c718cc67 user: olr tags: core, rg
Changes

Modified compile_rules_graph.py from [4a6b055c8f] to [86144631f9].

153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
    m = re.match("/(\\w+)/", sAction)
    if m:
        sOption = m.group(1)
        sAction = sAction[m.end():].strip()
    if nPriority == -1:
        nPriority = dOptPriority.get(sOption, 4)
    # valid action?
    m = re.search(r"(?P<action>[-~=/>])(?P<start>\d+\.?|)(?P<end>:\.?\d+|)>>", sAction)
    if not m:
        print(" # Error. No action found at: ", sActionId)
        return None
    # Condition
    sCondition = sAction[:m.start()].strip()
    if sCondition:
        sCondition = changeReferenceToken(sCondition, dPos)







|







153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
    m = re.match("/(\\w+)/", sAction)
    if m:
        sOption = m.group(1)
        sAction = sAction[m.end():].strip()
    if nPriority == -1:
        nPriority = dOptPriority.get(sOption, 4)
    # valid action?
    m = re.search(r"(?P<action>[-~=/%>])(?P<start>\d+\.?|)(?P<end>:\.?\d+|)>>", sAction)
    if not m:
        print(" # Error. No action found at: ", sActionId)
        return None
    # Condition
    sCondition = sAction[:m.start()].strip()
    if sCondition:
        sCondition = changeReferenceToken(sCondition, dPos)
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
        if sAction[0:1] == "=":
            sAction = prepareFunction(sAction)
            dFUNCTIONS["_g_p_"+sActionId] = sAction[1:]
            sAction = "=_g_p_"+sActionId
        elif sAction.startswith('"') and sAction.endswith('"'):
            sAction = sAction[1:-1]
        return [sOption, sCondition, cAction, sAction, iStartAction, iEndAction]
    elif cAction == "/":
        ## tags
        return [sOption, sCondition, cAction, sAction, iStartAction, iEndAction]
    elif cAction == "=":
        ## disambiguator
        if sAction[0:1] == "=":
            sAction = sAction[1:]
        if "define(" in sAction and not re.search(r"define\(\\\d+ *, *\[.*\] *\)", sAction):







|







248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
        if sAction[0:1] == "=":
            sAction = prepareFunction(sAction)
            dFUNCTIONS["_g_p_"+sActionId] = sAction[1:]
            sAction = "=_g_p_"+sActionId
        elif sAction.startswith('"') and sAction.endswith('"'):
            sAction = sAction[1:-1]
        return [sOption, sCondition, cAction, sAction, iStartAction, iEndAction]
    elif cAction == "%" or cAction == "/":
        ## tags
        return [sOption, sCondition, cAction, sAction, iStartAction, iEndAction]
    elif cAction == "=":
        ## disambiguator
        if sAction[0:1] == "=":
            sAction = sAction[1:]
        if "define(" in sAction and not re.search(r"define\(\\\d+ *, *\[.*\] *\)", sAction):

Modified gc_core/py/lang_core/gc_engine.py from [cc991a6483] to [d2b4f44276].

786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
                                    print("  COND_OK")
                                pass
                            elif cActionType == "/":
                                if bDebug:
                                    print("  SEMANTIC_TAG:\n  ", dRule[sRuleId])
                                nTokenStart = nTokenOffset + eAct[0]
                                nTokenEnd = nTokenOffset + eAct[1]
                                for i in range(nTokenStart, nTokenEnd+1)
                                    if "tags" in self.lToken[i]:
                                        self.lToken[i]["tags"].update(sWhat.split("|"))
                                    else:
                                        self.lToken[i]["tags"] = set(sWhat.split("|"))
                            elif cActionType == "%":
                                # sentence tags
                                if bDebug:







|







786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
                                    print("  COND_OK")
                                pass
                            elif cActionType == "/":
                                if bDebug:
                                    print("  SEMANTIC_TAG:\n  ", dRule[sRuleId])
                                nTokenStart = nTokenOffset + eAct[0]
                                nTokenEnd = nTokenOffset + eAct[1]
                                for i in range(nTokenStart, nTokenEnd+1):
                                    if "tags" in self.lToken[i]:
                                        self.lToken[i]["tags"].update(sWhat.split("|"))
                                    else:
                                        self.lToken[i]["tags"] = set(sWhat.split("|"))
                            elif cActionType == "%":
                                # sentence tags
                                if bDebug:

Modified gc_lang/fr/rules.grx from [5148be3923] to [cc460645f6].

5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
!!
!!

__tag_sujets__
    [je|j’]
    [moi|moi-même] qui
    [moi|moi-même] [seul|seule]
        <<- />> 1s

    tu
    t’  @:2s
    t’  [en|y]  @:2s
    [toi|toi-même] ?,¿ qui
    [toi|toi-même] [seul|seule]
        <<- />> 2s

    nous
    nous ?,¿ qui
    nous-même
    nous-mêmes
    nous [seul|seuls|seules]
    [et|ou] [moi|moi-même]
    ni [moi|moi-même]
    [moi|moi-même] et
        <<- />> 1p

    vous
    vous ?,¿ qui
    vous-même
    vous-mêmes
    vous [seul|seule|seuls|seules]
    [et|ou] [toi|toi-même]
    ni [toi|toi-même]
    [toi|toi-même] et
        <<- />> 2p


__tag_prop_sub__
    ce [que|qu’|qu]
        <<- />> ce_que


## Incohérences avec formes verbales 1sg et 2sg sans sujet

__conj_xxxai__sans_sujet!3__
    [se|s’]  ?[en|y|le|la|l’|les]¿  (~ai$)
        <<- /conj/ morph(\1, ":1s", ":(?:G|W|M|J|3[sp])")







|






|









|









|




|







5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
!!
!!

__tag_sujets__
    [je|j’]
    [moi|moi-même] qui
    [moi|moi-même] [seul|seule]
        <<- %>> 1s

    tu
    t’  @:2s
    t’  [en|y]  @:2s
    [toi|toi-même] ?,¿ qui
    [toi|toi-même] [seul|seule]
        <<- %>> 2s

    nous
    nous ?,¿ qui
    nous-même
    nous-mêmes
    nous [seul|seuls|seules]
    [et|ou] [moi|moi-même]
    ni [moi|moi-même]
    [moi|moi-même] et
        <<- %>> 1p

    vous
    vous ?,¿ qui
    vous-même
    vous-mêmes
    vous [seul|seule|seuls|seules]
    [et|ou] [toi|toi-même]
    ni [toi|toi-même]
    [toi|toi-même] et
        <<- %>> 2p


__tag_prop_sub__
    ce [que|qu’|qu]
        <<- %>> ce_que


## Incohérences avec formes verbales 1sg et 2sg sans sujet

__conj_xxxai__sans_sujet!3__
    [se|s’]  ?[en|y|le|la|l’|les]¿  (~ai$)
        <<- /conj/ morph(\1, ":1s", ":(?:G|W|M|J|3[sp])")