Mozilla Home
Privacy
Cookies
Legal
Bugzilla
Browse
Advanced Search
New Bug
Reports
Documentation
Log In
Log In with GitHub
or
Remember me
Browse
Advanced Search
New Bug
Reports
Documentation
Attachment 507324 Details for
Bug 355178
[patch]
Patch (v1)
355178.patch (text/plain), 11.44 KB, created by
(no longer active)
(
hide
)
Description:
Patch (v1)
Filename:
MIME Type:
Creator:
(no longer active)
Size:
11.44 KB
patch
obsolete
># HG changeset patch ># Parent c7f5a1af072b58299a9fa13c35e36e2968d107ce ># User Ehsan Akhgari <ehsan@mozilla.com> >Bug 355178 - Correct the tokenization of spell checker so that word boundary rules can be defined using the affix file > > >diff --git a/extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/upstream-hunspell.diff b/extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/upstream-hunspell.diff >--- a/extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/upstream-hunspell.diff >+++ b/extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/upstream-hunspell.diff >@@ -9458,106 +9458,108 @@ 41415a47226 > 41914c47725 > < schnaps's > --- > > schnaps/M > 41949c47760 > < schrod's > --- > > schrod/SM >-42883,42885c48694 >+41998a42010 >+> scot-free >+42883,42885c48695 > < shit's > < shit/S! > < shite/S! > --- > > shit/MS! >-42887,42888c48696,48697 >+42887,42888c48697,48698 > < shithead/S! > < shitload/! > --- > > shithead/MS! > > shitload/MS! >-42891c48700 >+42891c48701 > < shitty/RT! > --- > > shitty/TR! >-42976a48786 >+42976a48787 > > should've >-43008c48818 >+43008c48819 > < showtime > --- > > showtime/MS >-43724,43726c49534 >+43724,43726c49535 > < smoulder's > < smouldered > < smoulders > --- > > smoulder/GSMD >-44062c49870 >+44062c49871 > < sonofabitch > --- > > sonofabitch/! >-44371a50180 >+44371a50181 > > spick/S! >-44383c50192 >+44383c50193 > < spik/S > --- > > spik/S! >-46106a51916 >+46106a51917 > > syllabi >-46160c51970 >+46160c51971 > < synch/GMD > --- > > synch/GMDS >-46167d51976 >+46167d51977 > < synchs >-46203,46204c52012,52013 >+46203,46204c52013,52014 > < sysadmin/S > < sysop/S > --- > > sysadmin/MS > > sysop/MS >-46752a52562 >+46752a52563 > > terabit/MS >-46753a52564,52565 >+46753a52565,52566 > > terahertz/M > > terapixel/MS >-46817a52630 >+46817a52631 > > testcase/MS >-46831a52645 >+46831a52646 > > testsuite/MS >-46925a52740 >+46925a52741 > > theremin/MS >-47755a53571 >+47755a53572 > > transfect/DSMG >-47774a53591,53592 >+47774a53592,53593 > > transgenderism > > transgene/MS >-47951c53769 >+47951c53770 > < triage/M > --- > > triage/MG >-48869a54688 >+48869a54689 > > unlikeable >-49211c55030 >+49211c55031 > < vagina/M > --- > > vagina/MS >-49368,49369c55187 >+49368,49369c55188 > < velour's > < velours's > --- > > velour/MS >-49478a55297 >+49478a55298 > > vertices >-50148a55968 >+50148a55969 > > weaponize/DSG >-50260,50261d56079 >+50260,50261d56080 > < werwolf/M > < werwolves >-50728c56546 >+50728c56547 > < women > --- > > women/M >-50794c56612 >+50794c56613 > < wop/S! > --- > > wop/MS! >diff --git a/extensions/spellcheck/locales/en-US/hunspell/en-US.aff b/extensions/spellcheck/locales/en-US/hunspell/en-US.aff >--- a/extensions/spellcheck/locales/en-US/hunspell/en-US.aff >+++ b/extensions/spellcheck/locales/en-US/hunspell/en-US.aff >@@ -7,17 +7,52 @@ COMPOUNDMIN 1 > # only in compounds: 1th, 2th, 3th > ONLYINCOMPOUND c > # compound rules: > # 1. [0-9]*1[0-9]th (10th, 11th, 12th, 56714th, etc.) > # 2. [0-9]*[02-9](1st|2nd|3rd|[4-9]th) (21st, 22nd, 123rd, 1234th, etc.) > COMPOUNDRULE 2 > COMPOUNDRULE n*1t > COMPOUNDRULE n*mp >-WORDCHARS 0123456789 >+WORDCHARS 0123456789' >+ >+BREAK 33 >+BREAK ` >+BREAK " >+BREAK [ >+BREAK ] >+BREAK ( >+BREAK ) >+BREAK { >+BREAK } >+BREAK < >+BREAK > >+BREAK : >+BREAK , >+BREAK ! >+BREAK . >+BREAK ? >+BREAK / >+BREAK ; >+BREAK - >+BREAK ^- >+BREAK -$ >+BREAK @ >+BREAK ~ >+BREAK ` >+BREAK # >+BREAK $ >+BREAK % >+BREAK ^ >+BREAK & >+BREAK * >+BREAK = >+BREAK + >+BREAK | >+BREAK \ > > PFX A Y 1 > PFX A 0 re . > > PFX I Y 1 > PFX I 0 in . > > PFX U Y 1 >diff --git a/extensions/spellcheck/locales/en-US/hunspell/en-US.dic b/extensions/spellcheck/locales/en-US/hunspell/en-US.dic >--- a/extensions/spellcheck/locales/en-US/hunspell/en-US.dic >+++ b/extensions/spellcheck/locales/en-US/hunspell/en-US.dic >@@ -1,9 +1,9 @@ >-57434 >+57435 > 0/nm > 0th/pt > 1/n1 > 1st/p > 1th/tc > 2/nm > 2nd/p > 2th/tc >@@ -48136,16 +48136,17 @@ scorecard/MS > scorekeeper/MS > scoreless > scoreline/S > scorer/M > scorn/MDRSZG > scorner/M > scornful/Y > scorpion/MS >+scot-free > scotch/MDSG > scotchs > scoundrel/MS > scour/DRSZG > scourer/M > scourge/DSMG > scout/MDRSZG > scouting/M >diff --git a/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp b/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp >--- a/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp >+++ b/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp >@@ -894,22 +894,64 @@ WordSplitState::ClassifyCharacter(PRInt3 > return CHAR_CLASS_SEPARATOR; > if (ClassifyCharacter(aIndex + 1, false) != CHAR_CLASS_WORD) > return CHAR_CLASS_SEPARATOR; > > // char on either side is a word, this counts as a word > return CHAR_CLASS_WORD; > } > >+ // The dot character, if appearing at the end of a word, should >+ // be considered part of that word. Example: "etc.", or >+ // abbreviations >+ if (aIndex > 0 && >+ mDOMWordText[aIndex] == '.' && >+ mDOMWordText[aIndex - 1] != '.' && >+ ClassifyCharacter(aIndex - 1, false) != CHAR_CLASS_WORD) { >+ return CHAR_CLASS_WORD; >+ } >+ > // all other punctuation > if (charCategory == nsIUGenCategory::kSeparator || > charCategory == nsIUGenCategory::kOther || > charCategory == nsIUGenCategory::kPunctuation || >- charCategory == nsIUGenCategory::kSymbol) >- return CHAR_CLASS_SEPARATOR; >+ charCategory == nsIUGenCategory::kSymbol) { >+ PRBool start = PR_TRUE, end = PR_TRUE; >+ >+ PRInt32 tmpIndex = aIndex - 1; >+ if (tmpIndex >= 0) { >+ nsIUGenCategory::nsUGenCategory >+ charCategoryTmp = mWordUtil->GetCategories()->Get(PRUint32(mDOMWordText[tmpIndex])); >+ if (charCategoryTmp != nsIUGenCategory::kSeparator && >+ charCategoryTmp != nsIUGenCategory::kOther && >+ charCategoryTmp != nsIUGenCategory::kPunctuation && >+ charCategoryTmp != nsIUGenCategory::kSymbol) { >+ start = PR_FALSE; >+ } >+ } >+ if (start) { >+ return CHAR_CLASS_SEPARATOR; >+ } >+ >+ tmpIndex = aIndex + 1; >+ if (tmpIndex < PRInt32(mDOMWordText.Length())) { >+ nsIUGenCategory::nsUGenCategory >+ charCategoryTmp = mWordUtil->GetCategories()->Get(PRUint32(mDOMWordText[tmpIndex])); >+ if (charCategoryTmp != nsIUGenCategory::kSeparator && >+ charCategoryTmp != nsIUGenCategory::kOther && >+ charCategoryTmp != nsIUGenCategory::kPunctuation && >+ charCategoryTmp != nsIUGenCategory::kSymbol) { >+ end = PR_FALSE; >+ } >+ } >+ >+ if (end) { >+ return CHAR_CLASS_SEPARATOR; >+ } >+ } > > // any other character counts as a word > return CHAR_CLASS_WORD; > } > > > // WordSplitState::Advance > >diff --git a/layout/reftests/editor/reftest.list b/layout/reftests/editor/reftest.list >--- a/layout/reftests/editor/reftest.list >+++ b/layout/reftests/editor/reftest.list >@@ -43,8 +43,14 @@ asserts(1) == passwd-4.html passwd-ref.h > == caret_on_focus.html caret_on_focus-ref.html > != caret_on_textarea_lastline.html caret_on_textarea_lastline-ref.html > == input-text-onfocus-reframe.html input-text-onfocus-reframe-ref.html > == input-text-notheme-onfocus-reframe.html input-text-notheme-onfocus-reframe-ref.html > == caret_after_reframe.html caret_after_reframe-ref.html > == nobogusnode-1.html nobogusnode-ref.html > == nobogusnode-2.html nobogusnode-ref.html > == caret_on_input_edge.html caret_on_input_edge-ref.html >+== spellcheck-hyphen-valid.html spellcheck-hyphen-valid-ref.html >+!= spellcheck-hyphen-invalid.html spellcheck-hyphen-invalid-ref.html >+== spellcheck-slash-valid.html spellcheck-slash-valid-ref.html >+== spellcheck-period-valid.html spellcheck-period-valid-ref.html >+== spellcheck-space-valid.html spellcheck-space-valid-ref.html >+== spellcheck-comma-valid.html spellcheck-comma-valid-ref.html >diff --git a/layout/reftests/editor/spellcheck-comma-valid-ref.html b/layout/reftests/editor/spellcheck-comma-valid-ref.html >new file mode 100644 >--- /dev/null >+++ b/layout/reftests/editor/spellcheck-comma-valid-ref.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+ <body> >+ <textarea autofocus spellcheck="false">good,nice</textarea> >+ </body> >+</html> >diff --git a/layout/reftests/editor/spellcheck-comma-valid.html b/layout/reftests/editor/spellcheck-comma-valid.html >new file mode 100644 >--- /dev/null >+++ b/layout/reftests/editor/spellcheck-comma-valid.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+ <body> >+ <textarea autofocus>good,nice</textarea> >+ </body> >+</html> >diff --git a/layout/reftests/editor/spellcheck-hyphen-invalid-ref.html b/layout/reftests/editor/spellcheck-hyphen-invalid-ref.html >new file mode 100644 >--- /dev/null >+++ b/layout/reftests/editor/spellcheck-hyphen-invalid-ref.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+ <body> >+ <textarea autofocus spellcheck="false">dddf-gggy</textarea> >+ </body> >+</html> >diff --git a/layout/reftests/editor/spellcheck-hyphen-invalid.html b/layout/reftests/editor/spellcheck-hyphen-invalid.html >new file mode 100644 >--- /dev/null >+++ b/layout/reftests/editor/spellcheck-hyphen-invalid.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+ <body> >+ <textarea autofocus>dddf-gggy</textarea> >+ </body> >+</html> >diff --git a/layout/reftests/editor/spellcheck-hyphen-valid-ref.html b/layout/reftests/editor/spellcheck-hyphen-valid-ref.html >new file mode 100644 >--- /dev/null >+++ b/layout/reftests/editor/spellcheck-hyphen-valid-ref.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+ <body> >+ <textarea autofocus spellcheck="false">scot-free</textarea> >+ </body> >+</html> >diff --git a/layout/reftests/editor/spellcheck-hyphen-valid.html b/layout/reftests/editor/spellcheck-hyphen-valid.html >new file mode 100644 >--- /dev/null >+++ b/layout/reftests/editor/spellcheck-hyphen-valid.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+ <body> >+ <textarea autofocus>scot-free</textarea> >+ </body> >+</html> >diff --git a/layout/reftests/editor/spellcheck-period-valid-ref.html b/layout/reftests/editor/spellcheck-period-valid-ref.html >new file mode 100644 >--- /dev/null >+++ b/layout/reftests/editor/spellcheck-period-valid-ref.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+ <body> >+ <textarea autofocus spellcheck="false">good.nice</textarea> >+ </body> >+</html> >diff --git a/layout/reftests/editor/spellcheck-period-valid.html b/layout/reftests/editor/spellcheck-period-valid.html >new file mode 100644 >--- /dev/null >+++ b/layout/reftests/editor/spellcheck-period-valid.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+ <body> >+ <textarea autofocus>good.nice</textarea> >+ </body> >+</html> >diff --git a/layout/reftests/editor/spellcheck-slash-valid-ref.html b/layout/reftests/editor/spellcheck-slash-valid-ref.html >new file mode 100644 >--- /dev/null >+++ b/layout/reftests/editor/spellcheck-slash-valid-ref.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+ <body> >+ <textarea autofocus spellcheck="false">good/nice</textarea> >+ </body> >+</html> >diff --git a/layout/reftests/editor/spellcheck-slash-valid.html b/layout/reftests/editor/spellcheck-slash-valid.html >new file mode 100644 >--- /dev/null >+++ b/layout/reftests/editor/spellcheck-slash-valid.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+ <body> >+ <textarea autofocus>good/nice</textarea> >+ </body> >+</html> >diff --git a/layout/reftests/editor/spellcheck-space-valid-ref.html b/layout/reftests/editor/spellcheck-space-valid-ref.html >new file mode 100644 >--- /dev/null >+++ b/layout/reftests/editor/spellcheck-space-valid-ref.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+ <body> >+ <textarea autofocus spellcheck="false">good nice</textarea> >+ </body> >+</html> >diff --git a/layout/reftests/editor/spellcheck-space-valid.html b/layout/reftests/editor/spellcheck-space-valid.html >new file mode 100644 >--- /dev/null >+++ b/layout/reftests/editor/spellcheck-space-valid.html >@@ -0,0 +1,6 @@ >+<!DOCTYPE html> >+<html> >+ <body> >+ <textarea autofocus>good nice</textarea> >+ </body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Flags:
smaug
: review+
ehsan.akhgari
: approval2.0-
Actions:
View
|
Diff
|
Review
Attachments on
bug 355178
:
418524
|
418548
|
418549
|
418984
|
419239
|
431603
| 507324 |
507912
|
507917
|
508164
|
510837
|
526149