Details
-
Bug
-
Status: Open
-
Resolution: Unresolved
-
0.95
-
None
-
None
-
Operating System: Windows XP
Platform: PC
-
48745
Description
As already known, the hyphenation library has some problems with patterns who contain numbers like 7 or 8. I realized that HyphenationTree.unpackValues(int) extracts the characters ( and ' for these values. They differ by exactly 16 character positions in ASCII table. Following code changes transforms these characters into the right ones:
protected String unpackValues(int k) {
StringBuilder buf = new StringBuilder();
byte v = this.vspace.get(k++);
while (v != 0) {
char c = (char)((v >>> 4) - 1 + '0');
if (!Character.isDigit(c))
buf.append(c);
c = (char)(v & 0x0f);
if (c == 0)
c = (char)(c - 1 + '0');
if (!Character.isDigit(c))
buf.append(c);
v = this.vspace.get(k++);
}
return buf.toString();
}
But there's another problem which could be experienced in languages with common occurences of these two digits in patterns. Please compare the hyphenation result of the German word, "Flickenteppich", (Pattern: .fli7ck8en7tep7pic8h) with OpenOffice's result. OpenOffice doesn't generate a hyphenation like "Flick-enteppich". But FOP does it, even with the cheap bug fix above. There's an explicit prohibition at this word's position by the concerning pattern. Other implementations of Liang's algorithm do notice this rule (see http://www.davidashen.net/texhyphj.html or LibHnj used by OpenOffice).
My question is: Is this issue known? If yes, are there any existing trackers concerning this bug? When will this be fixed?
Best regards
PAX