aboutsummaryrefslogtreecommitdiff
path: root/test/liang.cc
diff options
context:
space:
mode:
authorsgeerken <devnull@localhost>2012-07-10 23:19:04 +0200
committersgeerken <devnull@localhost>2012-07-10 23:19:04 +0200
commitaf4420e3bbd894c7ed21dc676dfdd35d7149bd32 (patch)
tree3058368b0ea93a452b32e8f11c927ed894f766c0 /test/liang.cc
parent8b1467671cb6c48c7d1abf43c4cbd7ad7b0f5aa3 (diff)
For hyphenation, all characters not belonging to the actual word, e.g. punctuation marks, are ignored. Currently only words for English and German.y
Diffstat (limited to 'test/liang.cc')
-rw-r--r--test/liang.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/liang.cc b/test/liang.cc
index 5cee0b5f..026568d0 100644
--- a/test/liang.cc
+++ b/test/liang.cc
@@ -1,3 +1,4 @@
+
#include "../dw/fltkcore.hh"
#include "../dw/hyphenator.hh"
@@ -9,7 +10,7 @@ void hyphenateWord (dw::core::Platform *p, const char *word)
int *breakPos = h->hyphenateWord (word, &numBreaks);
for (int i = 0; i < numBreaks + 1; i++) {
if (i != 0)
- printf ("\xc2\xad");
+ printf (" \xc2\xad ");
int start = (i == 0 ? 0 : breakPos[i - 1]);
int end = (i == numBreaks ? strlen (word) : breakPos[i]);
for (int j = start; j < end; j++)
@@ -24,8 +25,10 @@ int main (int argc, char *argv[])
{
dw::fltk::FltkPlatform p;
+ hyphenateWord (&p, "...");
hyphenateWord (&p, "Jahrhundertroman");
hyphenateWord (&p, "JAHRHUNDERTROMAN");
+ hyphenateWord (&p, "„Jahrhundertroman“");
hyphenateWord (&p, "währenddessen");
hyphenateWord (&p, "Ückendorf");
hyphenateWord (&p, "über");
@@ -38,6 +41,10 @@ int main (int argc, char *argv[])
hyphenateWord (&p, "„Grundstücksverkehrsgenehmigungszuständigkeits"
"übertragungsverordnung“");
hyphenateWord (&p, "Grundstücksverkehrsgenehmigungszuständigkeit");
+ hyphenateWord (&p, "(6R,7R)-7-[2-(2-Amino-4-thiazolyl)-glyoxylamido]-3-"
+ "(2,5-dihydro-6-hydroxy-2-methyl-5-oxo-1,2,4-triazin-3-yl-"
+ "thiomethyl)-8-oxo-5-thia-1-azabicyclo[4.2.0]oct-2-en-2-"
+ "carbonsäure-7²-(Z)-(O-methyloxim)");
return 0;
}