diff options
Diffstat (limited to 'lib/kotext/kohyphen')
-rw-r--r-- | lib/kotext/kohyphen/CMakeLists.txt | 41 | ||||
-rw-r--r-- | lib/kotext/kohyphen/hyphdicts/CMakeLists.txt | 18 | ||||
-rw-r--r-- | lib/kotext/kohyphen/kohyphentest.cpp | 12 |
3 files changed, 68 insertions, 3 deletions
diff --git a/lib/kotext/kohyphen/CMakeLists.txt b/lib/kotext/kohyphen/CMakeLists.txt new file mode 100644 index 000000000..a9718a46c --- /dev/null +++ b/lib/kotext/kohyphen/CMakeLists.txt @@ -0,0 +1,41 @@ +############################################################################### +# Trinity KOffice # +# --------------- # +# This file is licensed under the terms of GNU GPL v3 or later. # +# Improvements and feedback are welcome. # +############################################################################### + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/lib/kofficecore + ${CMAKE_SOURCE_DIR}/lib/kofficeui + ${CMAKE_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + +### Libraries ################################################################# +tde_add_library(kohyphen STATIC_PIC AUTOMOC + SOURCES hnjalloc.c hyphen.c kohyphen.cpp + LINK tdecore-shared +) + +### Programs ################################################################## +if (BUILD_TESTS) + tde_add_executable(kohyphentest AUTOMOC + SOURCES kohyphentest.cpp + LINK + tdecore-shared tdeui-shared tdefx-shared tdeio-shared + tdetexteditor kohyphen-static + ) +endif() + +### Data ###################################################################### +add_subdirectory(hyphdicts) + +# kate: indent-width 2; replace-tabs true;
\ No newline at end of file diff --git a/lib/kotext/kohyphen/hyphdicts/CMakeLists.txt b/lib/kotext/kohyphen/hyphdicts/CMakeLists.txt new file mode 100644 index 000000000..95f8bb963 --- /dev/null +++ b/lib/kotext/kohyphen/hyphdicts/CMakeLists.txt @@ -0,0 +1,18 @@ +############################################################################### +# Trinity KOffice # +# --------------- # +# This file is licensed under the terms of GNU GPL v3 or later. # +# Improvements and feedback are welcome. # +############################################################################### + +### Data ###################################################################### +install( + FILES + dicts.xml + hyph_cs.dic hyph_en.dic hyph_hu.dic hyph_uk.dic hyph_da.dic hyph_de.dic + hyph_en_CA.dic hyph_es.dic hyph_fr.dic hyph_it.dic hyph_nl.dic hyph_pt_BR.dic + hyph_pt.dic hyph_pt_PT.dic hyph_ru.dic hyph_sk.dic hyph_sv.dic hyph_sl.dic + DESTINATION ${DATA_INSTALL_DIR}/koffice/hyphdicts +) + +# kate: indent-width 2; replace-tabs true;
\ No newline at end of file diff --git a/lib/kotext/kohyphen/kohyphentest.cpp b/lib/kotext/kohyphen/kohyphentest.cpp index 0f083631e..5a0d3ac0e 100644 --- a/lib/kotext/kohyphen/kohyphentest.cpp +++ b/lib/kotext/kohyphen/kohyphentest.cpp @@ -6,6 +6,7 @@ #include <tqstringlist.h> #include <tdeapplication.h> +#include <tdecmdlineargs.h> #include "kohyphen.h" #include <kdebug.h> @@ -40,7 +41,8 @@ void check_hyphenation( const TQStringList& tests, const TQStringList& results, int main (int argc, char ** argv) { - TDEApplication app(argc, argv, "KoHyphenator test"); + TDECmdLineArgs::init(argc, argv, "kohyphentest", "KoHyphenator test", 0, 0, true); + TDEApplication app; try { hypher = KoHyphenator::self(); @@ -54,8 +56,12 @@ int main (int argc, char ** argv) TQStringList::ConstIterator it, itres; //testing Czech language, this text is in UTF-8! - TQStringList cs_tests = TQStringList() << "Žluťoučký" << "kůň" << "úpěl" << - "ďábelské" << "ódy"; + TQStringList cs_tests; + cs_tests << TQString::fromLocal8Bit("Žluťoučký") + << TQString::fromLocal8Bit("kůň") + << TQString::fromLocal8Bit("úpěl") + << TQString::fromLocal8Bit("ďábelské") + << TQString::fromLocal8Bit("ódy"); for ( it = cs_tests.begin(); it != cs_tests.end() ; ++it ) kdDebug() << (*it) << " hyphenates like this: " << hypher->hyphenate((*it), "cs") << endl; |