diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index f25982ee..dcd0b0ca 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -21,7 +21,7 @@ on: - 'inflection/**' - '.github/workflows/**' env: - ICU_MAJOR: '77' + ICU_MAJOR: '78' ICU_MINOR: '1' jobs: @@ -36,13 +36,13 @@ jobs: - name: Download and install icu if: steps.cache.outputs.cache-hit != 'true' run: | - wget https://github.com/unicode-org/icu/releases/download/release-${ICU_MAJOR}-${ICU_MINOR}/icu4c-${ICU_MAJOR}_${ICU_MINOR}-Ubuntu22.04-x64.tgz + wget https://github.com/unicode-org/icu/releases/download/release-${ICU_MAJOR}.${ICU_MINOR}/icu4c-${ICU_MAJOR}.${ICU_MINOR}-Ubuntu22.04-x64.tgz export ICU=~/icu/ mkdir -p $ICU echo "ICU directory is $ICU" # Get the release and unpack. - cp icu4c-${ICU_MAJOR}_${ICU_MINOR}-Ubuntu22.04-x64.tgz $ICU + cp icu4c-${ICU_MAJOR}.${ICU_MINOR}-Ubuntu22.04-x64.tgz $ICU pushd $ICU pwd diff --git a/.github/workflows/create-ubuntu-distribution-packaging.yml b/.github/workflows/create-ubuntu-distribution-packaging.yml index 54bd76e7..a49bde28 100644 --- a/.github/workflows/create-ubuntu-distribution-packaging.yml +++ b/.github/workflows/create-ubuntu-distribution-packaging.yml @@ -2,7 +2,7 @@ # To update ICU version: # 1. Update the ICU_ICU_MAJOR and ICU_MINOR environment variable below. # 2. Check the ICU binary URL — is the filename still Ubuntu22.04-x64.tgz? -# (e.g., icu4c-78_1-Ubuntu22.04-x64.tgz) +# (e.g., icu4c-78.1-Ubuntu22.04-x64.tgz) # 3. Update inflection/CMakeLists.txt: # - Modify `CPACK_DEBIAN_PACKAGE_DEPENDS` to match the new ICU version. # ---------------------------------------------------------------------------------------- @@ -19,7 +19,7 @@ jobs: build-and-package: runs-on: ubuntu-latest env: - ICU_MAJOR: '77' + ICU_MAJOR: '78' ICU_MINOR: '1' steps: - name: Checkout @@ -51,9 +51,9 @@ jobs: if: steps.cache-icu.outputs.cache-hit != 'true' run: | cd /tmp - wget https://github.com/unicode-org/icu/releases/download/release-${ICU_MAJOR}-${ICU_MINOR}/icu4c-${ICU_MAJOR}_${ICU_MINOR}-Ubuntu22.04-x64.tgz + wget https://github.com/unicode-org/icu/releases/download/release-${ICU_MAJOR}.${ICU_MINOR}/icu4c-${ICU_MAJOR}.${ICU_MINOR}-Ubuntu22.04-x64.tgz mkdir icu-install - tar -xzf icu4c-${ICU_MAJOR}_${ICU_MINOR}-Ubuntu22.04-x64.tgz -C icu-install + tar -xzf icu4c-${ICU_MAJOR}.${ICU_MINOR}-Ubuntu22.04-x64.tgz -C icu-install sudo mkdir -p /usr/local/icu-${ICU_MAJOR}_${ICU_MINOR} sudo cp -r icu-install/icu/usr/local/* /usr/local/icu-${ICU_MAJOR}_${ICU_MINOR}/ sudo ldconfig diff --git a/.github/workflows/doxygen-gh-pages.yml b/.github/workflows/doxygen-gh-pages.yml index 4c452230..20644264 100644 --- a/.github/workflows/doxygen-gh-pages.yml +++ b/.github/workflows/doxygen-gh-pages.yml @@ -19,7 +19,7 @@ on: - '!fst/**' env: - ICU_MAJOR: '77' + ICU_MAJOR: '78' ICU_MINOR: '1' jobs: @@ -34,13 +34,13 @@ jobs: - name: Download and install icu if: steps.cache.outputs.cache-hit != 'true' run: | - wget https://github.com/unicode-org/icu/releases/download/release-${ICU_MAJOR}-${ICU_MINOR}/icu4c-${ICU_MAJOR}_${ICU_MINOR}-Ubuntu22.04-x64.tgz + wget https://github.com/unicode-org/icu/releases/download/release-${ICU_MAJOR}.${ICU_MINOR}/icu4c-${ICU_MAJOR}.${ICU_MINOR}-Ubuntu22.04-x64.tgz export ICU=~/icu/ mkdir -p $ICU echo "ICU directory is $ICU" # Get the release and unpack. - cp icu4c-${ICU_MAJOR}_${ICU_MINOR}-Ubuntu22.04-x64.tgz $ICU + cp icu4c-${ICU_MAJOR}.${ICU_MINOR}-Ubuntu22.04-x64.tgz $ICU pushd $ICU pwd diff --git a/.github/workflows/ubuntu-memory-check.yml b/.github/workflows/ubuntu-memory-check.yml index 05d6cbe7..e393950e 100644 --- a/.github/workflows/ubuntu-memory-check.yml +++ b/.github/workflows/ubuntu-memory-check.yml @@ -19,7 +19,7 @@ on: - '.github/workflows/**' - 'inflection/**' env: - ICU_MAJOR: '77' + ICU_MAJOR: '78' ICU_MINOR: '1' jobs: @@ -34,13 +34,13 @@ jobs: - name: Download and install icu if: steps.cache.outputs.cache-hit != 'true' run: | - wget https://github.com/unicode-org/icu/releases/download/release-${ICU_MAJOR}-${ICU_MINOR}/icu4c-${ICU_MAJOR}_${ICU_MINOR}-Ubuntu22.04-x64.tgz + wget https://github.com/unicode-org/icu/releases/download/release-${ICU_MAJOR}.${ICU_MINOR}/icu4c-${ICU_MAJOR}.${ICU_MINOR}-Ubuntu22.04-x64.tgz export ICU=~/icu/ mkdir -p $ICU echo "ICU directory is $ICU" # Get the release and unpack. - cp icu4c-${ICU_MAJOR}_${ICU_MINOR}-Ubuntu22.04-x64.tgz $ICU + cp icu4c-${ICU_MAJOR}.${ICU_MINOR}-Ubuntu22.04-x64.tgz $ICU pushd $ICU pwd diff --git a/inflection/CMakeLists.txt b/inflection/CMakeLists.txt index 7a045b7f..e6e14c0e 100644 --- a/inflection/CMakeLists.txt +++ b/inflection/CMakeLists.txt @@ -88,9 +88,7 @@ file(MAKE_DIRECTORY ${INFLECTION_INCLUDE_ROOT}) include(dependICU) -add_library(xml2 INTERFACE IMPORTED GLOBAL) -set_target_properties(xml2 PROPERTIES IMPORTED_LIBNAME xml2) -target_include_directories(xml2 INTERFACE ${CMAKE_OSX_SYSROOT}/usr/include/libxml2) +find_package(LibXml2 REQUIRED) # Runs Unicode Inflection unit tests: "make check" set(DYLD_LIBRARY_PATH ${ICU_LIB_DIRECTORY}:$) diff --git a/inflection/cmake/versions.mk b/inflection/cmake/versions.mk index 5c306d9b..62c48ab2 100644 --- a/inflection/cmake/versions.mk +++ b/inflection/cmake/versions.mk @@ -2,5 +2,5 @@ # Copyright 2021-2024 Apple Inc. All rights reserved. # CATCH2_VERSION := 3.9.0 -ICU_VERSION_MINIMUM := 77.1 +ICU_VERSION_MINIMUM := 78.1 MARISA_VERSION := 0.3.1 diff --git a/inflection/test/CMakeLists.txt b/inflection/test/CMakeLists.txt index 8ffdba40..aa92d315 100644 --- a/inflection/test/CMakeLists.txt +++ b/inflection/test/CMakeLists.txt @@ -8,7 +8,7 @@ target_link_libraries(itest PRIVATE inflection Catch2 - xml2 + LibXml2::LibXml2 marisa_objs ICU::uc ICU::i18n $<$:${PERFDATA_FRAMEWORK}> diff --git a/inflection/test/src/inflection/dialog/NumberConceptTest.cpp b/inflection/test/src/inflection/dialog/NumberConceptTest.cpp index 7eba6806..6de0ea15 100644 --- a/inflection/test/src/inflection/dialog/NumberConceptTest.cpp +++ b/inflection/test/src/inflection/dialog/NumberConceptTest.cpp @@ -382,7 +382,7 @@ TEST_CASE("NumberConceptTest#test_es_1") TEST_CASE("NumberConceptTest#testSwiss") { - REQUIRE(u"1’000" == ::inflection::dialog::NumberConcept((int64_t)1000, ::inflection::util::LocaleUtils::SWITZERLAND_GERMAN(), ::inflection::util::LocaleUtils::SWITZERLAND_GERMAN()).getAsDigits().getPrint()); + REQUIRE(u"1'000" == ::inflection::dialog::NumberConcept((int64_t)1000, ::inflection::util::LocaleUtils::SWITZERLAND_GERMAN(), ::inflection::util::LocaleUtils::SWITZERLAND_GERMAN()).getAsDigits().getPrint()); REQUIRE(u"1.000" == ::inflection::dialog::NumberConcept((int64_t)1000, ::inflection::util::LocaleUtils::SWITZERLAND_GERMAN(), ::inflection::util::LocaleUtils::SWITZERLAND_GERMAN()).getAsDigits().getSpeak()); REQUIRE(u"1" == ::inflection::dialog::NumberConcept((int64_t)1, ::inflection::util::LocaleUtils::SWITZERLAND_FRENCH(), ::inflection::util::LocaleUtils::SWITZERLAND_FRENCH()).getAsDigits().getSpeak()); REQUIRE(u"1,1" == ::inflection::dialog::NumberConcept(1.1, ::inflection::util::LocaleUtils::SWITZERLAND_FRENCH(), ::inflection::util::LocaleUtils::SWITZERLAND_FRENCH()).getAsDigits().getSpeak()); @@ -392,7 +392,7 @@ TEST_CASE("NumberConceptTest#testSwiss") REQUIRE(u"59" == ::inflection::dialog::NumberConcept((int64_t)59, ::inflection::util::LocaleUtils::SWITZERLAND_FRENCH(), ::inflection::util::LocaleUtils::SWITZERLAND_FRENCH()).getAsDigits().getSpeak()); REQUIRE(u"59" == ::inflection::dialog::NumberConcept((int64_t)59, ::inflection::util::LocaleUtils::FRENCH(), ::inflection::util::LocaleUtils::FRENCH()).getAsDigits().getPrint()); REQUIRE(u"59" == ::inflection::dialog::NumberConcept((int64_t)59, ::inflection::util::LocaleUtils::FRENCH(), ::inflection::util::LocaleUtils::FRENCH()).getAsDigits().getSpeak()); - REQUIRE(u"1’000" == ::inflection::dialog::NumberConcept((int64_t)1000, ::inflection::util::LocaleUtils::SWITZERLAND_ITALIAN(), ::inflection::util::LocaleUtils::SWITZERLAND_ITALIAN()).getAsDigits().getPrint()); + REQUIRE(u"1'000" == ::inflection::dialog::NumberConcept((int64_t)1000, ::inflection::util::LocaleUtils::SWITZERLAND_ITALIAN(), ::inflection::util::LocaleUtils::SWITZERLAND_ITALIAN()).getAsDigits().getPrint()); REQUIRE(u"1.000" == ::inflection::dialog::NumberConcept((int64_t)1000, ::inflection::util::LocaleUtils::SWITZERLAND_ITALIAN(), ::inflection::util::LocaleUtils::SWITZERLAND_ITALIAN()).getAsDigits().getSpeak()); } diff --git a/inflection/tools/CMakeLists.txt b/inflection/tools/CMakeLists.txt index 47f8f34c..db3e6547 100644 --- a/inflection/tools/CMakeLists.txt +++ b/inflection/tools/CMakeLists.txt @@ -11,7 +11,6 @@ endif() set(CMAKE_CXX_FLAGS_${BUILD_TYPE} ${CMAKE_CXX_FLAGS_RELEASE}) target_link_libraries(tool_libraries INTERFACE - xml2 ICU::uc ICU::i18n $<$:${CMAKE_DL_LIBS}> ) diff --git a/inflection/tools/buildDictionary/CMakeLists.txt b/inflection/tools/buildDictionary/CMakeLists.txt index 98f00e54..457bd325 100644 --- a/inflection/tools/buildDictionary/CMakeLists.txt +++ b/inflection/tools/buildDictionary/CMakeLists.txt @@ -7,6 +7,7 @@ add_executable(buildDictionary ${BUILD_DICTIONARY_SOURCES}) target_link_libraries(buildDictionary PRIVATE tool_libraries + LibXml2::LibXml2 marisa_objs inflection_tool_objs resource_objs diff --git a/inflection/tools/buildDictionary/LexicalDictionaryBuilder.cpp b/inflection/tools/buildDictionary/LexicalDictionaryBuilder.cpp index 5d176f1d..3c226797 100644 --- a/inflection/tools/buildDictionary/LexicalDictionaryBuilder.cpp +++ b/inflection/tools/buildDictionary/LexicalDictionaryBuilder.cpp @@ -6,7 +6,6 @@ #include "InflectionDictionary.hpp" #include -#include #include #include #include @@ -170,6 +169,9 @@ createPropertyValueMap( auto inflectionVal = inflectionContainerMap.find(value); if (inflectionVal == inflectionContainerMap.end()) { auto numID = npc(inflectionDictionary)->getId(value); + if (numID == -1) { + throw inflection::exception::IllegalStateException(std::u16string(value) + u" inflection name not found."); + } inflectionContainerMap.emplace(value, numID); } } diff --git a/inflection/tools/dictionary-parser/src/main/java/org/unicode/wikidata/Grammar.java b/inflection/tools/dictionary-parser/src/main/java/org/unicode/wikidata/Grammar.java index b189409f..e80c1f0a 100644 --- a/inflection/tools/dictionary-parser/src/main/java/org/unicode/wikidata/Grammar.java +++ b/inflection/tools/dictionary-parser/src/main/java/org/unicode/wikidata/Grammar.java @@ -960,7 +960,7 @@ public String toString() { TYPEMAP.put("Q5551966", EnumSet.of(Ignorable.IGNORABLE_LEMMA)); // phraseme TYPEMAP.put("Q3734650", EnumSet.of(Ignorable.IGNORABLE_LEMMA)); // adverbial phrase, a phrase the head of which is an adverb TYPEMAP.put("Q357760", EnumSet.of(Ignorable.IGNORABLE_LEMMA)); // adjectival phrase - TYPEMAP.put("Q56042915", EnumSet.of(Ignorable.IGNORABLE_LEMMA)); // prepositional phrase + TYPEMAP.put("Q3397768", EnumSet.of(Ignorable.IGNORABLE_LEMMA)); // prepositional phrase/prepositional syntagma TYPEMAP.put("Q1778442", EnumSet.of(Ignorable.IGNORABLE_LEMMA)); // verb phrase TYPEMAP.put("Q384876", EnumSet.of(Ignorable.IGNORABLE_LEMMA)); // set phrase TYPEMAP.put("Q3062294", EnumSet.of(Ignorable.IGNORABLE_LEMMA)); // Latin phrase diff --git a/inflection/tools/xml2cpp/CMakeLists.txt b/inflection/tools/xml2cpp/CMakeLists.txt index 869136f1..06b1bf5d 100644 --- a/inflection/tools/xml2cpp/CMakeLists.txt +++ b/inflection/tools/xml2cpp/CMakeLists.txt @@ -3,5 +3,5 @@ # file(GLOB_RECURSE XML2CPP_SOURCES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) add_executable(xml2cpp ${XML2CPP_SOURCES}) -target_link_libraries(xml2cpp xml2) +target_link_libraries(xml2cpp LibXml2::LibXml2) add_dependencies(tools xml2cpp) \ No newline at end of file