1 From 88cf975c295e3ec808efb77bb1a2a031d77f0c89 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?=
3 <laszlo.nemeth@collabora.com>
4 Date: Thu, 5 Oct 2017 12:24:02 +0200
5 Subject: [PATCH] Allow dotted I in dictionary, and disable bad capitalization
8 Dictionary words weren't recognized with dotted I, but dictionary
9 words with the letter i were recognized with dotted I, too.
11 src/hunspell/hunspell.cxx | 18 +++++++++++++-----
12 1 file changed, 13 insertions(+), 5 deletions(-)
14 diff --git a/src/hunspell/hunspell.cxx b/src/hunspell/hunspell.cxx
15 index 1ef11df..5c98f8a 100644
16 --- a/src/hunspell/hunspell.cxx
17 +++ b/src/hunspell/hunspell.cxx
18 @@ -562,11 +562,15 @@ bool HunspellImpl::spell(const std::string& word, int* info, std::string* root)
23 + // handle special capitalization of dotted I
24 + bool Idot = (utf8 && (unsigned char) scw[0] == 0xc4 && (unsigned char) scw[1] == 0xb0);
25 *info += SPELL_ORIGCAP;
26 - mkallsmall2(scw, sunicw);
27 - std::string u8buffer(scw);
28 - mkinitcap2(scw, sunicw);
29 + if (captype == ALLCAP) {
30 + mkallsmall2(scw, sunicw);
31 + mkinitcap2(scw, sunicw);
33 + scw.replace(0, 1, "\xc4\xb0");
35 if (captype == INITCAP)
36 *info += SPELL_INITCAP;
37 rv = checkword(scw, info, root);
38 @@ -581,9 +585,13 @@ bool HunspellImpl::spell(const std::string& word, int* info, std::string* root)
40 if (rv && is_keepcase(rv) && (captype == ALLCAP))
43 + if (rv || (Idot && langnum != LANG_az && langnum != LANG_tr && langnum != LANG_crh))
46 + mkallsmall2(scw, sunicw);
47 + std::string u8buffer(scw);
48 + mkinitcap2(scw, sunicw);
50 rv = checkword(u8buffer, info, root);
52 u8buffer.push_back('.');