diff options
author | László Németh <nemeth@numbertext.org> | 2012-09-13 07:50:50 +0000 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2012-09-13 07:50:50 +0000 |
commit | d2dc7334af18d611a301fd4fe96237a68ff3e8ab (patch) | |
tree | 02dc7824ce8b039777efdfaff42db2dbb386df9a | |
parent | fc16d4340d06b4349a3598a0fccbd09f72f1fd8f (diff) | |
download | hyphen-d2dc7334af18d611a301fd4fe96237a68ff3e8ab.tar.gz |
fdo#43931 (hard hyphen hyphenation) + fdo#54843 (rhmin fix)
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | hyphen.c | 12 | ||||
-rw-r--r-- | tests/rhmin.hyph | 1 | ||||
-rw-r--r-- | tests/rhmin.pat | 1 | ||||
-rw-r--r-- | tests/rhmin.word | 1 |
6 files changed, 24 insertions, 7 deletions
@@ -1,4 +1,13 @@ -2010-07-18 Caolán McNamara <caolán at redhat dot com>: +2012-09-13 László Németh <nemeth at numbertext dot org>: + * hyphen.c: fdo#43931: removing hard hyphen hyphenation for LibreOffice + + * tests/rhmin.*: add Telugu test example for rhmin fix + +2012-09-11 Steven Dickson <DicksonSK at ldschurch dot org>: + * hyphen.c: fdo#54843: rhmin fix for words with 3-byte or more UTF-8 + multibyte characters + +2012-07-18 Caolán McNamara <caolán at redhat dot com>: * coverity warnings 2011-10-10 László Németh <nemeth at numbertext dot org>: @@ -1,3 +1,8 @@ +2012-09-13 Hyphen 2.8.6: + - righthyphenmin fix for 3-byte or more UTF-8 + multibyte characters by Steven Dickson + - fix for fdo#43931 (removing hard hyphen hyphenation for LibreOffice) + 2012-07-12 Hyphen 2.8.5: - fix short alloc @@ -436,9 +436,9 @@ for (k = 0; k < 2; k++) { } } else if (k == 1) { /* default first level: hyphen and ASCII apostrophe */ - if (!dict[0]->utf8) hnj_hyphen_load_line("NOHYPHEN '\n", dict[k], hashtab); - else hnj_hyphen_load_line("NOHYPHEN ',\xe2\x80\x93,\xe2\x80\x99\n", dict[k], hashtab); - strncpy(buf, "1-1/=,1,1\n", MAX_CHARS-1); // buf rewritten by hnj_hyphen_load here + if (!dict[0]->utf8) hnj_hyphen_load_line("NOHYPHEN ',-\n", dict[k], hashtab); + else hnj_hyphen_load_line("NOHYPHEN ',\xe2\x80\x93,\xe2\x80\x99,-\n", dict[k], hashtab); + strncpy(buf, "1-1\n", MAX_CHARS-1); // buf rewritten by hnj_hyphen_load here buf[MAX_CHARS-1] = '\0'; hnj_hyphen_load_line(buf, dict[k], hashtab); /* remove hyphen */ hnj_hyphen_load_line("1'1\n", dict[k], hashtab); /* ASCII apostrophe */ @@ -734,13 +734,13 @@ int hnj_hyphen_lhmin(int utf8, const char *word, int word_size, char * hyphens, int hnj_hyphen_rhmin(int utf8, const char *word, int word_size, char * hyphens, char *** rep, int ** pos, int ** cut, int rhmin) { - int i = 1; + int i = 0; int j; // ignore numbers for (j = word_size - 1; j > 0 && word[j] <= '9' && word[j] >= '0'; j--) i--; - for (j = word_size - 2; i < rhmin && j > 0; j--) { + for (j = word_size - 1; i < rhmin && j > 0; j--) { // check length of the non-standard part if (*rep && *pos && *cut && (*rep)[j]) { char * rh = strchr((*rep)[j], '='); @@ -753,7 +753,7 @@ int hnj_hyphen_rhmin(int utf8, const char *word, int word_size, char * hyphens, } else { hyphens[j] = '0'; } - if (!utf8 || (word[j] & 0xc0) != 0xc0) i++; + if (!utf8 || (word[j] & 0xc0) == 0xc0 || (word[j] & 0x80) != 0x80) i++; } return 0; } diff --git a/tests/rhmin.hyph b/tests/rhmin.hyph index 2fe18d3..637dd64 100644 --- a/tests/rhmin.hyph +++ b/tests/rhmin.hyph @@ -1 +1,2 @@ övéit +అం=గ=డిధర diff --git a/tests/rhmin.pat b/tests/rhmin.pat index 862c488..108163f 100644 --- a/tests/rhmin.pat +++ b/tests/rhmin.pat @@ -2,3 +2,4 @@ UTF-8 RIGHTHYPHENMIN 3 % test patterns for righthyphenmin fix for UTF-8 patterns övé1it +అం1గ1డి1ధర diff --git a/tests/rhmin.word b/tests/rhmin.word index 2fe18d3..1dd8273 100644 --- a/tests/rhmin.word +++ b/tests/rhmin.word @@ -1 +1,2 @@ övéit +అంగడిధర |