diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e1601f..9e689fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ project(FuzzyMatch) cmake_minimum_required(VERSION 3.5.1) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") if(TARGET OpenNMTTokenizer) diff --git a/cli/src/CMakeLists.txt b/cli/src/CMakeLists.txt index 5050fee..38923ee 100644 --- a/cli/src/CMakeLists.txt +++ b/cli/src/CMakeLists.txt @@ -10,5 +10,5 @@ target_include_directories(${PROJECT_NAME} PUBLIC target_link_libraries(${PROJECT_NAME}-cli ${PROJECT_NAME} - ${Boost_LIBRARIES} + Boost::program_options ) diff --git a/include/fuzzy/sentence.hh b/include/fuzzy/sentence.hh index 5b77e40..d8fbc8c 100644 --- a/include/fuzzy/sentence.hh +++ b/include/fuzzy/sentence.hh @@ -4,6 +4,17 @@ #include #include +// +// Even latest Debian Sid (March 2023) uses Boost 1.74 which does not behave well with very fresh compilers and triggers this error: +// https://github.com/pavel-odintsov/fastnetmon/issues/970 +// This bug was fixed in fresh Boost versions: https://github.com/boostorg/serialization/issues/219 and we apply workaround only for 1.74 +// + +#include +#if BOOST_VERSION / 100000 == 1 && BOOST_VERSION / 100 % 1000 == 74 +#include +#endif + #include #include diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d818197..746d385 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,6 +38,8 @@ target_include_directories(${PROJECT_NAME} PUBLIC target_link_libraries(${PROJECT_NAME} ${OPENNMT_TOKENIZER_LIB} ${ICU_LIBRARIES} - ${Boost_LIBRARIES} + Boost::serialization + Boost::iostreams + Boost::system Threads::Threads ) diff --git a/src/fuzzy_match.cc b/src/fuzzy_match.cc index 84dfa83..2dcc7c5 100644 --- a/src/fuzzy_match.cc +++ b/src/fuzzy_match.cc @@ -86,6 +86,8 @@ namespace fuzzy _ptokenizer->add_alphabet_to_segment("Kanbun"); _ptokenizer->add_alphabet_to_segment("Katakana"); _ptokenizer->add_alphabet_to_segment("Hiragana"); + _ptokenizer->add_alphabet_to_segment("Thai"); + _ptokenizer->add_alphabet_to_segment("Myanmar"); // Burmese } void diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 27026d3..ca6675d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,11 +2,11 @@ add_executable(${PROJECT_NAME}-test test.cc) find_package(GTest REQUIRED) -find_package(Boost COMPONENTS filesystem REQUIRED) +find_package(Boost COMPONENTS filesystem system serialization REQUIRED) include_directories( ${source_dir}/include - ${GTEST_INCLUDE_DIRS} + ${GTest_INCLUDE_DIRS} ) target_include_directories(${PROJECT_NAME}-test PUBLIC @@ -17,8 +17,9 @@ target_include_directories(${PROJECT_NAME}-test PUBLIC target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME} GTest::GTest GTest::Main - ${Boost_FILESYSTEM_LIBRARY} - ${GTEST_LIBRARIES} + Boost::filesystem + Boost::serialization + Boost::system ) set(${PROJECT_NAME}-test-args "${CMAKE_CURRENT_LIST_DIR}/data/")