Grammalecte  Check-in [fccf7fa150]

Overview
Comment:[graphspell] bValidToken always true if token has a list of tokens
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: fccf7fa150c6681819794308ab24d1ee8ca7d62ef2725ccf05ae2c4d7feff47b
User & Date: olr on 2020-10-28 15:37:57
Other Links: manifest | tags
Context
2020-10-31
17:43
[fr] ajustements check-in: ea86352a28 user: olr tags: fr, trunk
2020-10-28
15:37
[graphspell] bValidToken always true if token has a list of tokens check-in: fccf7fa150 user: olr tags: graphspell, trunk
14:43
[fr] ajustements check-in: 7ca244e02e user: olr tags: fr, trunk
Changes

Modified graphspell-js/spellchecker.js from [a2bcf6d2aa] to [09462696fb].

   177    177           if (!this.lexicographer) {
   178    178               return;
   179    179           }
   180    180           if (!oToken.hasOwnProperty("lMorph")) {
   181    181               oToken["lMorph"] = this.getMorph(oToken["sValue"]);
   182    182           }
   183    183           if (oToken["sType"].startsWith("WORD")) {
   184         -            oToken["bValidToken"] = this.isValidToken(oToken["sValue"]);
          184  +            oToken["bValidToken"] = (oToken.hasOwnProperty("lMorph")) ? true : this.isValidToken(oToken["sValue"]);
   185    185               let [sPrefix, sStem, sSuffix] = this.lexicographer.split(oToken["sValue"]);
   186    186               if (sStem != oToken["sValue"]) {
   187    187                   oToken["lSubTokens"] = [
   188    188                       { "sType": "WORD", "sValue": sPrefix, "lMorph": this.getMorph(sPrefix) },
   189    189                       { "sType": "WORD", "sValue": sStem,   "lMorph": this.getMorph(sStem)   },
   190    190                       { "sType": "WORD", "sValue": sSuffix, "lMorph": this.getMorph(sSuffix) }
   191    191                   ];

Modified graphspell/spellchecker.py from [6207eb55be] to [2bdbe76996].

   143    143                   - lSubTokens for each parts of the split token
   144    144           """
   145    145           if not self.lexicographer:
   146    146               return
   147    147           if "lMorph" not in dToken:
   148    148               dToken["lMorph"] = self.getMorph(dToken["sValue"])
   149    149           if dToken["sType"].startswith("WORD"):
   150         -            dToken["bValidToken"] = self.isValidToken(dToken["sValue"])
          150  +            dToken["bValidToken"] = True  if "lMorph" in dToken  else self.isValidToken(dToken["sValue"])
   151    151               sPrefix, sStem, sSuffix = self.lexicographer.split(dToken["sValue"])
   152    152               if sStem != dToken["sValue"]:
   153    153                   dToken["lSubTokens"] = [
   154    154                       { "sType": "WORD", "sValue": sPrefix, "lMorph": self.getMorph(sPrefix) },
   155    155                       { "sType": "WORD", "sValue": sStem,   "lMorph": self.getMorph(sStem)   },
   156    156                       { "sType": "WORD", "sValue": sSuffix, "lMorph": self.getMorph(sSuffix) }
   157    157                   ]