Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
- 'inflection/**'
- '.github/workflows/**'
env:
ICU_MAJOR: '77'
ICU_MAJOR: '78'
ICU_MINOR: '1'

jobs:
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/create-ubuntu-distribution-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
# ----------------------------------------------------------------------------------------
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/doxygen-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
- '!fst/**'

env:
ICU_MAJOR: '77'
ICU_MAJOR: '78'
ICU_MINOR: '1'

jobs:
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ubuntu-memory-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
- '.github/workflows/**'
- 'inflection/**'
env:
ICU_MAJOR: '77'
ICU_MAJOR: '78'
ICU_MINOR: '1'

jobs:
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions inflection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}:$<TARGET_FILE_DIR:inflection>)
Expand Down
2 changes: 1 addition & 1 deletion inflection/cmake/versions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get Linux and macOS to use the same version.

MARISA_VERSION := 0.3.1
2 changes: 1 addition & 1 deletion inflection/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ target_link_libraries(itest
PRIVATE
inflection
Catch2
xml2
LibXml2::LibXml2
marisa_objs
ICU::uc ICU::i18n
$<$<PLATFORM_ID:Darwin>:${PERFDATA_FRAMEWORK}>
Expand Down
4 changes: 2 additions & 2 deletions inflection/test/src/inflection/dialog/NumberConceptTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ TEST_CASE("NumberConceptTest#test_es_1")

TEST_CASE("NumberConceptTest#testSwiss")
{
REQUIRE(u"1000" == ::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());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required by ICU 78.1 used by macOS GitHub action.

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());
Expand All @@ -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"1000" == ::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());
}

Expand Down
1 change: 0 additions & 1 deletion inflection/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
$<$<PLATFORM_ID:Linux>:${CMAKE_DL_LIBS}>
)
Expand Down
1 change: 1 addition & 0 deletions inflection/tools/buildDictionary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "InflectionDictionary.hpp"
#include <inflection/dictionary/DictionaryMetaData_MMappedDictionary.hpp>
#include <inflection/dictionary/Inflector.hpp>
#include <inflection/dictionary/Inflector_MMappedDictionary.hpp>
#include <inflection/dictionary/metadata/CompressedArray.hpp>
#include <inflection/dictionary/metadata/StringArrayContainer.hpp>
Expand Down Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This got renamed in Wikidata.

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
Expand Down
2 changes: 1 addition & 1 deletion inflection/tools/xml2cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Loading