Grammalecte  Check-in [0f461c6f8d]

Overview
Comment:[core] fix capitalization for suggestions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | core
Files: files | file ages | folders
SHA3-256: 0f461c6f8d678782cf2a4995b93ec9ced6817550244fbce0d0e7f7efa3bbd691
User & Date: olr on 2020-07-06 19:03:59
Other Links: manifest | tags
Context
2020-07-06
19:15
[core][js] update custom string functions for JavaScript check-in: d9bc063523 user: olr tags: trunk, core
19:03
[core] fix capitalization for suggestions check-in: 0f461c6f8d user: olr tags: trunk, core
19:03
[core][js] update custom string functions for JavaScript check-in: 24a0724d18 user: olr tags: trunk, core
Changes

Modified gc_core/js/lang_core/gc_engine.js from [fd4f80b37d] to [fd075f5592].

820
821
822
823
824
825
826
827

828
829
830
831
832
833
834
820
821
822
823
824
825
826

827
828
829
830
831
832
833
834







-
+







            lSugg = (sSugg) ? sSugg.split("|") : [];
        } else if (sSugg == "_") {
            lSugg = [];
        } else {
            lSugg = this._expand(sSugg, nTokenOffset, nLastToken).split("|");
        }
        if (bCaseSvty && lSugg.length > 0 && this.lToken[iFirstToken]["sValue"].slice(0,1).gl_isUpperCase()) {
            lSugg = (this.lToken[iFirstToken]["sValue"].gl_isUpperCase()) ? lSugg.map((s) => s.toUpperCase()) : capitalizeArray(lSugg);
            lSugg = (this.sSentence.slice(nStart, nEnd).gl_isUpperCase()) ? lSugg.map((s) => s.toUpperCase()) : capitalizeArray(lSugg);
        }
        // Message
        let sMessage = (sMsg.startsWith("=")) ? oEvalFunc[sMsg.slice(1)](this.lToken, nTokenOffset, nLastToken) : this._expand(sMsg, nTokenOffset, nLastToken);
        if (bShowRuleId) {
            sMessage += "  #" + sLineId + " / " + sRuleId;
        }
        //

Modified gc_core/py/lang_core/gc_engine.py from [73a9be1db8] to [c3ca9ed5e0].

701
702
703
704
705
706
707
708

709
710
711
712
713
714
715
701
702
703
704
705
706
707

708
709
710
711
712
713
714
715







-
+







            sSugg = globals()[sSugg[1:]](self.lToken, nTokenOffset, nLastToken)
            lSugg = sSugg.split("|")  if sSugg  else []
        elif sSugg == "_":
            lSugg = []
        else:
            lSugg = self._expand(sSugg, nTokenOffset, nLastToken).split("|")
        if bCaseSvty and lSugg and self.lToken[iFirstToken]["sValue"][0:1].isupper():
            lSugg = list(map(lambda s: s.upper(), lSugg))  if self.lToken[iFirstToken]["sValue"].isupper()  else list(map(lambda s: s[0:1].upper()+s[1:], lSugg))
            lSugg = list(map(lambda s: s.upper(), lSugg))  if self.sSentence[nStart:nEnd].isupper()  else list(map(lambda s: s[0:1].upper()+s[1:], lSugg))
        # Message
        sMessage = globals()[sMsg[1:]](self.lToken, nTokenOffset, nLastToken)  if sMsg[0:1] == "="  else self._expand(sMsg, nTokenOffset, nLastToken)
        if bShowRuleId:
            sMessage += "  #" + sLineId + " / " + sRuleId
        #
        if _bWriterError:
            return self._createErrorForWriter(nStart, nEnd - nStart, sRuleId, sOption, sMessage, lSugg, sURL)

Modified gc_lang/fr/rules.grx from [35a0227630] to [55c412e069].

4338
4339
4340
4341
4342
4343
4344

4345
4346
4347
4348
4349
4350
4351
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352







+







TEST: être {{en porte à faux}}
TEST: des tractations {{en sous main}}
TEST: Il ne connaît pas {{grand chose}} à tout ça.
TEST: {{ici bas}}, n’attends rien de bon, à moins que…
TEST: {{jusque là}}, tout va bien
TEST: {{Là bas}}.                                                               ->> Là-bas
TEST: elle viendra, {{n’est ce pas}} ?
TEST: {{N’est ce pas}}                                                          ->> N’est-ce pas
TEST: seulement par {{ouï dire}}.
TEST: {{par derrière}} la maison
TEST: Tout ce que nous faisons {{par ci, par là}}.
TEST: {{par dessus}}                                                            ->> par-dessus
TEST: Que vas-tu faire {{vis à vis}} d’eux                                      ->> vis-à-vis