Overview
Comment: | [build] new checkAgreement function, [core] remove legacy code, [fr] clarification conj 3pl |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | fr | core | build |
Files: | files | file ages | folders |
SHA3-256: |
967fb3887c59e9a1dee231e9373379f9 |
User & Date: | olr on 2020-05-08 19:18:58 |
Other Links: | manifest | tags |
Context
2020-05-09
| ||
07:33 | [fr] ajustements pour conjugaisons [core] remove legacy code check-in: d858319927 user: olr tags: trunk, fr, core | |
2020-05-08
| ||
19:18 | [build] new checkAgreement function, [core] remove legacy code, [fr] clarification conj 3pl check-in: 967fb3887c user: olr tags: trunk, fr, core, build | |
18:12 | [fr] ajustements et faux positifs check-in: 74b71b524a user: olr tags: trunk, fr | |
Changes
Modified compile_rules_graph.py from [14532ae517] to [a158723aa9].
︙ | |||
53 54 55 56 57 58 59 60 61 62 63 64 65 66 | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | + | sCode = re.sub(r"\b(morph|analyse|tag|value)\(<(\d+)", 'g_\\1(g_token(lToken, nTokenOffset+1-\\2)', sCode) # previous token sCode = re.sub(r"\bspell *[(]", '_oSpellChecker.isValid(', sCode) sCode = re.sub(r"\bbefore\(\s*", 'look(sSentence[:lToken[1+nTokenOffset]["nStart"]], ', sCode) # before(sCode) sCode = re.sub(r"\bafter\(\s*", 'look(sSentence[lToken[nLastToken]["nEnd"]:], ', sCode) # after(sCode) sCode = re.sub(r"\bbefore0\(\s*", 'look(sSentence0[:lToken[1+nTokenOffset]["nStart"]], ', sCode) # before0(sCode) sCode = re.sub(r"\bafter0\(\s*", 'look(sSentence[lToken[nLastToken]["nEnd"]:], ', sCode) # after0(sCode) sCode = re.sub(r"\banalyseWord[(]", 'analyse(', sCode) sCode = re.sub(r"\bcheckAgreement[(]\\(\d+), *\\(\d+)", 'g_checkAgreement(lToken[nTokenOffset+\\1], lToken[nTokenOffset+\\2]', sCode) sCode = re.sub(r"[\\](\d+)", 'lToken[nTokenOffset+\\1]["sValue"]', sCode) sCode = re.sub(r"[\\]-(\d+)", 'lToken[nLastToken-\\1+1]["sValue"]', sCode) sCode = re.sub(r">1", 'lToken[nLastToken+1]["sValue"]', sCode) sCode = re.sub(r"<1", 'lToken[nTokenOffset]["sValue"]', sCode) return sCode |
︙ |
Modified gc_lang/fr/modules-js/gce_analyseur.js from [d1adb20722] to [9617baecc3].
︙ | |||
47 48 49 50 51 52 53 | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | } function apposition (sWord1, sWord2) { // returns true if nom + nom (no agreement required) return sWord2.length < 2 || (cregex.mbNomNotAdj(_oSpellChecker.getMorph(sWord2)) && cregex.mbPpasNomNotAdj(_oSpellChecker.getMorph(sWord1))); } |
︙ | |||
109 110 111 112 113 114 115 116 117 118 119 120 121 122 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | + + + + + + + + + + + + + | } //if cregex.isNomAdjVerb(lMorph1): # considered true if (bLastHopeCond) { return true; } return false; } function g_checkAgreement (oToken1, oToken2) { // check agreement between <oToken1> and <oToken2> let lMorph1 = oToken1.hasOwnProperty("lMorph") ? oToken1["lMorph"] : _oSpellChecker.getMorph(oToken1["sValue"]); if (lMorph1.length === 0) { return true; } let lMorph2 = oToken2.hasOwnProperty("lMorph") ? oToken2["lMorph"] : _oSpellChecker.getMorph(oToken2["sValue"]); if (lMorph2.length === 0) { return true; } return cregex.checkAgreement(lMorph1, lMorph2); } function checkAgreement (sWord1, sWord2) { let lMorph2 = _oSpellChecker.getMorph(sWord2); if (lMorph2.length === 0) { return true; } let lMorph1 = _oSpellChecker.getMorph(sWord1); |
︙ |
Modified gc_lang/fr/modules/gce_analyseur.py from [09993a8236] to [8df2416282].
︙ | |||
36 37 38 39 40 41 42 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | - - - - - - - - - - - - - - - - - - - - - - - - - - | return s1 + " et " + s2 def apposition (sWord1, sWord2): "returns True if nom + nom (no agreement required)" return len(sWord2) < 2 or (cr.mbNomNotAdj(_oSpellChecker.getMorph(sWord2)) and cr.mbPpasNomNotAdj(_oSpellChecker.getMorph(sWord1))) |
︙ | |||
84 85 86 87 88 89 90 91 92 93 94 95 96 97 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | + + + + + + + + + + + | if cr.isNomAdj(lMorph1): return True #if cr.isNomAdjVerb(lMorph1): # considered True if bLastHopeCond: return True return False def g_checkAgreement (dToken1, dToken2): "check agreement between <dToken1> and <dToken2>" lMorph1 = dToken1["lMorph"] if "lMorph" in dToken1 else _oSpellChecker.getMorph(dToken1["sValue"]) if not lMorph1: return True lMorph2 = dToken2["lMorph"] if "lMorph" in dToken2 else _oSpellChecker.getMorph(dToken2["sValue"]) if not lMorph2: return True return cr.checkAgreement(lMorph1, lMorph2) def checkAgreement (sWord1, sWord2): "check agreement between <sWord1> and <sWord1>" lMorph2 = _oSpellChecker.getMorph(sWord2) if not lMorph2: return True lMorph1 = _oSpellChecker.getMorph(sWord1) |
︙ |
Modified gc_lang/fr/rules.grx from [d7aa7b1dc0] to [43d6b2bea4].
︙ | |||
26941 26942 26943 26944 26945 26946 26947 | 26941 26942 26943 26944 26945 26946 26947 26948 26949 26950 26951 26952 26953 26954 26955 26956 26957 26958 26959 26960 26961 26962 26963 26964 26965 26966 26967 26968 26969 26970 26971 26972 26973 26974 | - + + - + - - - + - + + | TEST: Vous pouvez tous triompher de votre adversaire avec de la ruse. TEST: tous prendre une bonne cuite, voilà ce que nous allons faire. TEST: on va tous manger au resto. TEST: elles vont toutes aller faire un tour __conj_det_plur_nom__ |
︙ |