fdo#43931 (hard hyphen hyphenation) + fdo#54843 (rhmin fix)

This commit is contained in:
László Németh 2012-09-13 07:50:50 +00:00
parent fc16d4340d
commit d2dc7334af
6 changed files with 24 additions and 7 deletions

View File

@ -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>:

5
NEWS
View File

@ -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

View File

@ -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;
}

View File

@ -1 +1,2 @@
övéit
అం=గ=డిధర

View File

@ -2,3 +2,4 @@ UTF-8
RIGHTHYPHENMIN 3
% test patterns for righthyphenmin fix for UTF-8 patterns
övé1it
1గ1డి1ధర

View File

@ -1 +1,2 @@
övéit
అంగడిధర