summaryrefslogtreecommitdiff
path: root/external/hunspell/0001-Allow-dotted-I-in-dictionary-and-disable-bad-capital.patch
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2017-11-02 09:51:36 +0100
committerAndras Timar <andras.timar@collabora.com>2017-11-06 17:50:04 +0100
commitf037207675010fdff2c1968a67fae5b0c2c34331 (patch)
treeda0e0d233368adc67063e024a72b2391db8a3d03 /external/hunspell/0001-Allow-dotted-I-in-dictionary-and-disable-bad-capital.patch
parenta7cd63df37144eba8544f6b10b83737fa0496461 (diff)
fix spell checking issues using recent Hunspell patches
Test: English word "Ian" are "item" are not allowed as "İan", "İtem" now. Patch list with commit ids in Hunspell repository: commit 66badb7449c2053c89456f11a7f71f3f5916b550 Extend dotless i and dotted I rules to Crimean Tatar language commit 88cf975c295e3ec808efb77bb1a2a031d77f0c89 Allow dotted I in dictionary, and disable bad capitalization commit 39b785a6b03b35cc8a27f43f6005dcaa432694e1 FORBIDDENWORD precedes BREAK commit 0f691abe68788d0a58e72ab66877a9f670cd2741 Remove forbidden words from dash suggestion list commit 15b2cde4f01706f0a648518a5cfc57394d015448 tdf#95024 fix compound handling for new Hungarian orthography commit de3ae6844af62300e473f7b7b66a56e54153b4b9 fix compound word part "pa:" Change-Id: Id12b5629b0c975464072b5b144743cbe40fe45a3 Reviewed-on: https://gerrit.libreoffice.org/44200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'external/hunspell/0001-Allow-dotted-I-in-dictionary-and-disable-bad-capital.patch')
-rw-r--r--external/hunspell/0001-Allow-dotted-I-in-dictionary-and-disable-bad-capital.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/external/hunspell/0001-Allow-dotted-I-in-dictionary-and-disable-bad-capital.patch b/external/hunspell/0001-Allow-dotted-I-in-dictionary-and-disable-bad-capital.patch
new file mode 100644
index 000000000000..b4b04385c935
--- /dev/null
+++ b/external/hunspell/0001-Allow-dotted-I-in-dictionary-and-disable-bad-capital.patch
@@ -0,0 +1,55 @@
+From 88cf975c295e3ec808efb77bb1a2a031d77f0c89 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?=
+ <laszlo.nemeth@collabora.com>
+Date: Thu, 5 Oct 2017 12:24:02 +0200
+Subject: [PATCH] Allow dotted I in dictionary, and disable bad capitalization
+ of i.
+
+Dictionary words weren't recognized with dotted I, but dictionary
+words with the letter i were recognized with dotted I, too.
+---
+ src/hunspell/hunspell.cxx | 18 +++++++++++++-----
+ 1 file changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/src/hunspell/hunspell.cxx b/src/hunspell/hunspell.cxx
+index 1ef11df..5c98f8a 100644
+--- a/src/hunspell/hunspell.cxx
++++ b/src/hunspell/hunspell.cxx
+@@ -562,11 +562,15 @@ bool HunspellImpl::spell(const std::string& word, int* info, std::string* root)
+ }
+ }
+ case INITCAP: {
+-
++ // handle special capitalization of dotted I
++ bool Idot = (utf8 && (unsigned char) scw[0] == 0xc4 && (unsigned char) scw[1] == 0xb0);
+ *info += SPELL_ORIGCAP;
+- mkallsmall2(scw, sunicw);
+- std::string u8buffer(scw);
+- mkinitcap2(scw, sunicw);
++ if (captype == ALLCAP) {
++ mkallsmall2(scw, sunicw);
++ mkinitcap2(scw, sunicw);
++ if (Idot)
++ scw.replace(0, 1, "\xc4\xb0");
++ }
+ if (captype == INITCAP)
+ *info += SPELL_INITCAP;
+ rv = checkword(scw, info, root);
+@@ -581,9 +585,13 @@ bool HunspellImpl::spell(const std::string& word, int* info, std::string* root)
+ }
+ if (rv && is_keepcase(rv) && (captype == ALLCAP))
+ rv = NULL;
+- if (rv)
++ if (rv || (Idot && langnum != LANG_az && langnum != LANG_tr && langnum != LANG_crh))
+ break;
+
++ mkallsmall2(scw, sunicw);
++ std::string u8buffer(scw);
++ mkinitcap2(scw, sunicw);
++
+ rv = checkword(u8buffer, info, root);
+ if (abbv && !rv) {
+ u8buffer.push_back('.');
+--
+1.9.1
+