mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 318040 - Accept abbreviated words without dots to workaround incomplete tokenization. r=ehsan
This commit is contained in:
parent
eb03343cf8
commit
556afefc27
@ -352,6 +352,12 @@ int Hunspell::spell(const char * word, int * info, char ** root)
|
||||
if (rl && rl->conv(word, wspace)) wl = cleanword2(cw, wspace, unicw, &nc, &captype, &abbv);
|
||||
else wl = cleanword2(cw, word, unicw, &nc, &captype, &abbv);
|
||||
|
||||
#ifdef MOZILLA_CLIENT
|
||||
// accept the abbreviated words without dots
|
||||
// workaround for the incomplete tokenization of Mozilla
|
||||
abbv = 1;
|
||||
#endif
|
||||
|
||||
if (wl == 0 || maxdic == 0) return 1;
|
||||
if (root) *root = NULL;
|
||||
|
||||
|
28
extensions/spellcheck/hunspell/src/patches/11-318040.diff
Normal file
28
extensions/spellcheck/hunspell/src/patches/11-318040.diff
Normal file
@ -0,0 +1,28 @@
|
||||
Bug 318040 - Accept abbreviated words without dots to workaround incomplete tokenization. r=ehsan
|
||||
|
||||
diff --git a/extensions/spellcheck/hunspell/src/hunspell.cxx b/extensions/spellcheck/hunspell/src/hunspell.cxx
|
||||
--- a/extensions/spellcheck/hunspell/src/hunspell.cxx
|
||||
+++ b/extensions/spellcheck/hunspell/src/hunspell.cxx
|
||||
@@ -347,16 +347,22 @@ int Hunspell::spell(const char * word, i
|
||||
int abbv = 0;
|
||||
int wl = 0;
|
||||
|
||||
// input conversion
|
||||
RepList * rl = (pAMgr) ? pAMgr->get_iconvtable() : NULL;
|
||||
if (rl && rl->conv(word, wspace)) wl = cleanword2(cw, wspace, unicw, &nc, &captype, &abbv);
|
||||
else wl = cleanword2(cw, word, unicw, &nc, &captype, &abbv);
|
||||
|
||||
+#ifdef MOZILLA_CLIENT
|
||||
+ // accept the abbreviated words without dots
|
||||
+ // workaround for the incomplete tokenization of Mozilla
|
||||
+ abbv = 1;
|
||||
+#endif
|
||||
+
|
||||
if (wl == 0 || maxdic == 0) return 1;
|
||||
if (root) *root = NULL;
|
||||
|
||||
// allow numbers with dots, dashes and commas (but forbid double separators: "..", "--" etc.)
|
||||
enum { NBEGIN, NNUM, NSEP };
|
||||
int nstate = NBEGIN;
|
||||
int i;
|
||||
|
Loading…
Reference in New Issue
Block a user