aboutsummaryrefslogtreecommitdiff
path: root/test/liang.cc
diff options
context:
space:
mode:
authorsgeerken <devnull@localhost>2012-06-25 16:53:21 +0200
committersgeerken <devnull@localhost>2012-06-25 16:53:21 +0200
commit466943b3be2ebdedf4949103993c4625775385ca (patch)
tree6c6f49920bc2d87036eb32dda1cf7d43f1898e20 /test/liang.cc
parent6af0048a5a0df6bbcc3785f17418a6fca31eeac6 (diff)
Static hash map for hyphenators. Patterns are loaded from /usr/local/lib/dillo/hyphenation.
Diffstat (limited to 'test/liang.cc')
-rw-r--r--test/liang.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/liang.cc b/test/liang.cc
index 4b5279a8..8d58a5b5 100644
--- a/test/liang.cc
+++ b/test/liang.cc
@@ -4,8 +4,10 @@
using namespace lout::object;
using namespace lout::container::typed;
-void hyphenateWord (dw::Hyphenator *h, const char *word)
+void hyphenateWord (dw::core::Platform *p, const char *word)
{
+ dw::Hyphenator *h = dw::Hyphenator::getHyphenator (p, "de");
+
Vector <String> *pieces = h->hyphenateWord (word);
for (int i = 0; i < pieces->size (); i++) {
if (i != 0)
@@ -19,15 +21,14 @@ void hyphenateWord (dw::Hyphenator *h, const char *word)
int main (int argc, char *argv[])
{
dw::fltk::FltkPlatform p;
- dw::Hyphenator h (&p, "test/hyph-de-1996.pat");
- hyphenateWord (&h, "Jahrhundertroman");
- hyphenateWord (&h, "JAHRHUNDERTROMAN");
- hyphenateWord (&h, "währenddessen");
- hyphenateWord (&h, "Ückendorf");
- hyphenateWord (&h, "über");
- hyphenateWord (&h, "aber");
- hyphenateWord (&h, "Ackermann");
+ hyphenateWord (&p, "Jahrhundertroman");
+ hyphenateWord (&p, "JAHRHUNDERTROMAN");
+ hyphenateWord (&p, "währenddessen");
+ hyphenateWord (&p, "Ückendorf");
+ hyphenateWord (&p, "über");
+ hyphenateWord (&p, "aber");
+ hyphenateWord (&p, "Ackermann");
return 0;
}