lib Library API Documentation

kohyphentest.cpp

00001 //KoHyphenator test, Lukas Tinkl <lukas.tinkl@suse.cz> 00002 00003 #include <stdio.h> 00004 #include <stdlib.h> 00005 00006 #include <qstringlist.h> 00007 00008 #include <kapplication.h> 00009 00010 #include "kohyphen.h" 00011 #include <kdebug.h> 00012 00013 int main (int argc, char ** argv) 00014 { 00015 KApplication app(argc, argv, "KoHyphenator test"); 00016 00017 //testing Czech language, this text is in UTF-8! 00018 QStringList cs_tests = QStringList() << "Žluťoučký" << "kůň" << "úpěl" << 00019 "ďábelské" << "ódy"; 00020 00021 //testing English 00022 QStringList en_tests = QStringList() << "Follow" << "white" << "rabbit"; 00023 00024 KoHyphenator * hypher = 0L; 00025 try { 00026 hypher = KoHyphenator::self(); 00027 } 00028 catch (KoHyphenatorException &e) 00029 { 00030 kdDebug() << e.message() << endl; 00031 return 1; 00032 } 00033 00034 QStringList::ConstIterator it = cs_tests.begin(); 00035 00036 while (it!=cs_tests.end()) { 00037 kdDebug() << (*it) << " hyphenates like this: " << hypher->hyphenate((*it), "cs") << endl; 00038 ++it; 00039 } 00040 00041 it = en_tests.begin(); 00042 00043 while (it!=en_tests.end()) { 00044 kdDebug() << (*it) << " hyphenates like this: " << hypher->hyphenate((*it), "en") << endl; 00045 ++it; 00046 } 00047 00048 return 0; 00049 }
KDE Logo
This file is part of the documentation for lib Library Version 1.3.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Sep 28 04:04:00 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003