react-native-executorch 0.10.5 → 0.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/android/build.gradle.kts +4 -3
- package/ios/RnExecutorch.mm +15 -17
- package/lib/module/fetcher/fetcher.js +35 -122
- package/lib/module/fetcher/fetcher.js.map +1 -1
- package/lib/module/fetcher/telemetry.js +1 -1
- package/lib/module/index.js +12 -13
- package/lib/module/index.js.map +1 -1
- package/lib/module/models.js +4 -2
- package/lib/module/models.js.map +1 -1
- package/lib/typescript/src/fetcher/fetcher.d.ts +3 -7
- package/lib/typescript/src/fetcher/fetcher.d.ts.map +1 -1
- package/lib/typescript/src/models.d.ts.map +1 -1
- package/package.json +9 -7
- package/react-native-executorch.podspec +6 -2
- package/src/fetcher/fetcher.ts +38 -131
- package/src/fetcher/telemetry.ts +1 -1
- package/src/models.ts +6 -1
- package/third-party/common/phonemis/CMakeLists.txt +70 -14
- package/third-party/common/phonemis/README.md +183 -33
- package/third-party/common/phonemis/THIRD_PARTY_NOTICES.md +57 -0
- package/third-party/common/phonemis/knowledge/code_style.md +642 -0
- package/third-party/common/phonemis/licenses/Unicode-3.0.txt +39 -0
- package/third-party/common/phonemis/licenses/misaki-Apache-2.0.txt +201 -0
- package/third-party/common/phonemis/licenses/nlohmann-json-MIT.txt +21 -0
- package/third-party/common/phonemis/licenses/xsimd-BSD-3-Clause.txt +29 -0
- package/third-party/common/phonemis/src/phonemis/base/config.h +6 -0
- package/third-party/common/phonemis/src/phonemis/base/ipipeline.cpp +75 -0
- package/third-party/common/phonemis/src/phonemis/base/ipipeline.h +21 -0
- package/third-party/common/phonemis/src/phonemis/base/phonemizer/constants.h +2 -5
- package/third-party/common/phonemis/src/phonemis/base/phonemizer/lexicon_phonemizer.cpp +3 -4
- package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/neural_phonemizer.cpp +17 -8
- package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/neural_phonemizer.h +4 -0
- package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/tokenizer.cpp +21 -6
- package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/tokenizer.h +13 -4
- package/third-party/common/phonemis/src/phonemis/base/pipeline.cpp +8 -0
- package/third-party/common/phonemis/src/phonemis/base/pipeline.h +19 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/common/conditions.cpp +37 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/common/conditions.h +45 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/common/constants.h +10 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/common/context.cpp +105 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/common/context.h +49 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/common/document.cpp +173 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/common/document.h +67 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/common/text.cpp +75 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/common/text.h +60 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/common/types.h +18 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/config.h +53 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layer.h +9 -7
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/constants.h +20 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/layer.cpp +89 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/layer.h +35 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/types.h +16 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/kind.h +40 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/layer.h +382 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/notation.h +30 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/numerals.cpp +51 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/numerals.h +31 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern.h +30 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern_set.cpp +17 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern_set.h +31 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/patterns.cpp +811 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/patterns.h +285 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/primitives.cpp +64 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/primitives.h +23 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/types.h +94 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/sanitizer/layer.cpp +19 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/{sanitizer_layer.h → layers/sanitizer/layer.h} +8 -8
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/sym2word/layer.cpp +65 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/sym2word/layer.h +29 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/layer.cpp +170 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/layer.h +40 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/types.h +25 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/trim/layer.cpp +47 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/layers/trim/layer.h +19 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/preprocessor.cpp +60 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/preprocessor.h +45 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/processor.cpp +6 -7
- package/third-party/common/phonemis/src/phonemis/base/processor/processor.h +14 -10
- package/third-party/common/phonemis/src/phonemis/base/tagger/hmm_tagger.cpp +89 -52
- package/third-party/common/phonemis/src/phonemis/base/tagger/hmm_tagger.h +16 -9
- package/third-party/common/phonemis/src/phonemis/base/tokenizer/tokenizer.cpp +13 -12
- package/third-party/common/phonemis/src/phonemis/lang/de/constants.h +183 -19
- package/third-party/common/phonemis/src/phonemis/lang/de/num2word.cpp +355 -309
- package/third-party/common/phonemis/src/phonemis/lang/de/num2word.h +42 -17
- package/third-party/common/phonemis/src/phonemis/lang/de/patterns.cpp +56 -0
- package/third-party/common/phonemis/src/phonemis/lang/de/patterns.h +15 -0
- package/third-party/common/phonemis/src/phonemis/lang/de/pipeline.h +3 -3
- package/third-party/common/phonemis/src/phonemis/lang/en/constants.h +181 -30
- package/third-party/common/phonemis/src/phonemis/lang/en/hmm_tagger.cpp +5 -7
- package/third-party/common/phonemis/src/phonemis/lang/en/num2word.cpp +232 -135
- package/third-party/common/phonemis/src/phonemis/lang/en/num2word.h +41 -16
- package/third-party/common/phonemis/src/phonemis/lang/en/pipeline.h +3 -10
- package/third-party/common/phonemis/src/phonemis/lang/es/constants.h +182 -60
- package/third-party/common/phonemis/src/phonemis/lang/es/num2word.cpp +247 -212
- package/third-party/common/phonemis/src/phonemis/lang/es/num2word.h +38 -18
- package/third-party/common/phonemis/src/phonemis/lang/es/patterns.cpp +50 -0
- package/third-party/common/phonemis/src/phonemis/lang/es/patterns.h +15 -0
- package/third-party/common/phonemis/src/phonemis/lang/es/pipeline.h +3 -3
- package/third-party/common/phonemis/src/phonemis/lang/fr/constants.h +152 -26
- package/third-party/common/phonemis/src/phonemis/lang/fr/num2word.cpp +252 -179
- package/third-party/common/phonemis/src/phonemis/lang/fr/num2word.h +38 -15
- package/third-party/common/phonemis/src/phonemis/lang/fr/patterns.cpp +83 -0
- package/third-party/common/phonemis/src/phonemis/lang/fr/patterns.h +15 -0
- package/third-party/common/phonemis/src/phonemis/lang/fr/pipeline.h +3 -3
- package/third-party/common/phonemis/src/phonemis/lang/hi/constants.h +62 -10
- package/third-party/common/phonemis/src/phonemis/lang/hi/num2word.cpp +74 -123
- package/third-party/common/phonemis/src/phonemis/lang/hi/num2word.h +27 -16
- package/third-party/common/phonemis/src/phonemis/lang/hi/pipeline.h +5 -3
- package/third-party/common/phonemis/src/phonemis/lang/it/constants.h +122 -42
- package/third-party/common/phonemis/src/phonemis/lang/it/num2word.cpp +200 -207
- package/third-party/common/phonemis/src/phonemis/lang/it/num2word.h +30 -18
- package/third-party/common/phonemis/src/phonemis/lang/it/patterns.cpp +25 -0
- package/third-party/common/phonemis/src/phonemis/lang/it/patterns.h +15 -0
- package/third-party/common/phonemis/src/phonemis/lang/it/pipeline.h +3 -3
- package/third-party/common/phonemis/src/phonemis/lang/pl/constants.h +346 -77
- package/third-party/common/phonemis/src/phonemis/lang/pl/num2word.cpp +631 -246
- package/third-party/common/phonemis/src/phonemis/lang/pl/num2word.h +47 -15
- package/third-party/common/phonemis/src/phonemis/lang/pl/pipeline.h +6 -6
- package/third-party/common/phonemis/src/phonemis/lang/pt/constants.h +201 -0
- package/third-party/common/phonemis/src/phonemis/lang/pt/num2word.cpp +365 -0
- package/third-party/common/phonemis/src/phonemis/lang/pt/num2word.h +53 -0
- package/third-party/common/phonemis/src/phonemis/lang/pt/pipeline.h +4 -2
- package/third-party/common/phonemis/src/phonemis/main.cpp +42 -11
- package/third-party/common/phonemis/src/phonemis/protophone/meta.h +24 -0
- package/third-party/common/phonemis/src/phonemis/protophone/numeric.h +26 -0
- package/third-party/common/phonemis/src/phonemis/protophone/protophone.cpp +525 -0
- package/third-party/common/phonemis/src/phonemis/protophone/protophone.h +80 -0
- package/third-party/common/phonemis/src/phonemis/protophone/tensor.h +76 -0
- package/third-party/common/phonemis/src/phonemis/protophone/tensor_utils.h +89 -0
- package/third-party/common/phonemis/src/phonemis/protophone/tensor_view.h +125 -0
- package/third-party/common/phonemis/src/phonemis/protophone/types.h +43 -0
- package/third-party/common/phonemis/src/phonemis/utils/strings.h +20 -14
- package/third-party/common/phonemis/src/phonemis/utils/unicode.h +15 -1
- package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_arithmetic.hpp +267 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_bit.hpp +232 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_cast.hpp +43 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_complex.hpp +112 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_details.hpp +386 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_logical.hpp +240 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_math.hpp +2601 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_memory.hpp +1006 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_rounding.hpp +72 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_swizzle.hpp +260 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_trigo.hpp +996 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/utils/shifts.hpp +82 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx.hpp +2111 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx2.hpp +1591 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx2_128.hpp +170 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512bw.hpp +724 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512cd.hpp +28 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512dq.hpp +270 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512er.hpp +17 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512f.hpp +2919 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512ifma.hpp +17 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512pf.hpp +17 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vbmi.hpp +76 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vbmi2.hpp +130 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vnni_avx512bw.hpp +17 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vnni_avx512vbmi2.hpp +17 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx_128.hpp +164 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avxvnni.hpp +17 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_common.hpp +26 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_common_fwd.hpp +127 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_constants.hpp +393 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_emulated.hpp +787 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_avx.hpp +93 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_avx2.hpp +46 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_sse.hpp +97 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma4.hpp +92 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_i8mm_neon64.hpp +17 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_isa.hpp +148 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_neon.hpp +3580 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_neon64.hpp +1614 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_rvv.hpp +1515 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_scalar.hpp +1210 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse2.hpp +2333 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse3.hpp +66 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse4_1.hpp +510 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse4_2.hpp +44 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_ssse3.hpp +186 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sve.hpp +1186 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_vsx.hpp +947 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_vxe.hpp +787 -0
- package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_wasm.hpp +1819 -0
- package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_arch.hpp +242 -0
- package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_config.hpp +633 -0
- package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features.hpp +50 -0
- package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_arm.hpp +132 -0
- package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_ppc.hpp +54 -0
- package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_riscv.hpp +95 -0
- package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_s390x.hpp +56 -0
- package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_x86.hpp +1121 -0
- package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpuid.hpp +144 -0
- package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_getauxval.hpp +159 -0
- package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_macros.hpp +78 -0
- package/third-party/common/phonemis/src/third-party/xsimd/math/xsimd_rem_pio2.hpp +707 -0
- package/third-party/common/phonemis/src/third-party/xsimd/memory/xsimd_aligned_allocator.hpp +349 -0
- package/third-party/common/phonemis/src/third-party/xsimd/memory/xsimd_alignment.hpp +102 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_all_registers.hpp +57 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_api.hpp +3106 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx2_register.hpp +57 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512bw_register.hpp +51 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512cd_register.hpp +51 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512dq_register.hpp +51 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512er_register.hpp +51 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512f_register.hpp +77 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512ifma_register.hpp +51 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512pf_register.hpp +51 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vbmi2_register.hpp +51 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vbmi_register.hpp +51 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vnni_avx512bw_register.hpp +54 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vnni_avx512vbmi2_register.hpp +53 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx_register.hpp +79 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avxvnni_register.hpp +44 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch.hpp +1666 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch_constant.hpp +572 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch_fwd.hpp +41 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_common_arch.hpp +49 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_emulated_register.hpp +80 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_avx2_register.hpp +50 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_avx_register.hpp +50 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_sse_register.hpp +50 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma4_register.hpp +50 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_i8mm_neon64_register.hpp +55 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_neon64_register.hpp +55 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_neon_register.hpp +130 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_register.hpp +96 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_rvv_register.hpp +491 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse2_register.hpp +59 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse3_register.hpp +49 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse4_1_register.hpp +48 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse4_2_register.hpp +48 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_ssse3_register.hpp +48 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sve_register.hpp +216 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_traits.hpp +409 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_utils.hpp +462 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_vsx_register.hpp +84 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_vxe_register.hpp +86 -0
- package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_wasm_register.hpp +59 -0
- package/third-party/common/phonemis/src/third-party/xsimd/utils/bits.hpp +122 -0
- package/third-party/common/phonemis/src/third-party/xsimd/utils/xsimd_type_traits.hpp +145 -0
- package/third-party/common/phonemis/src/third-party/xsimd/xsimd.hpp +43 -0
- package/third-party/common/phonemis/src/phonemis/base/processor/constants.h +0 -11
- package/third-party/common/phonemis/src/phonemis/base/processor/num2word/config.h +0 -16
- package/third-party/common/phonemis/src/phonemis/base/processor/num2word/layer.cpp +0 -271
- package/third-party/common/phonemis/src/phonemis/base/processor/num2word/layer.h +0 -45
- package/third-party/common/phonemis/src/phonemis/base/processor/num2word/types.h +0 -29
- package/third-party/common/phonemis/src/phonemis/base/processor/sanitizer_layer.cpp +0 -22
- package/third-party/common/phonemis/src/phonemis/base/processor/trim_layer.cpp +0 -40
- package/third-party/common/phonemis/src/phonemis/base/processor/trim_layer.h +0 -22
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
#include <span>
|
|
7
7
|
#include <string>
|
|
8
8
|
#include <unordered_map>
|
|
9
|
-
#include <
|
|
9
|
+
#include <vector>
|
|
10
10
|
|
|
11
11
|
namespace phonemis::tagger {
|
|
12
12
|
|
|
@@ -34,15 +34,22 @@ protected:
|
|
|
34
34
|
*/
|
|
35
35
|
virtual bool should_lowercase(std::u32string_view word) const { return false; }
|
|
36
36
|
|
|
37
|
-
//
|
|
38
|
-
|
|
37
|
+
// Tags are stored as a dense, sorted integer index: tag_names_[id] is the
|
|
38
|
+
// tag string. Every probability table below is indexed by this id, so the
|
|
39
|
+
// Viterbi hot path uses array lookups instead of hashing tag strings.
|
|
40
|
+
std::vector<Tag> tag_names_;
|
|
39
41
|
|
|
40
|
-
//
|
|
41
|
-
std::
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
//
|
|
45
|
-
|
|
42
|
+
// start_probs_[id] : log P(first tag == id)
|
|
43
|
+
std::vector<double> start_probs_;
|
|
44
|
+
|
|
45
|
+
// transition_probs_[prev * T + curr] : log P(curr | prev), with
|
|
46
|
+
// T == tag_names_.size(). Missing transitions are pre-filled with a small
|
|
47
|
+
// log-epsilon, so the recursion needs no per-cell presence check.
|
|
48
|
+
std::vector<double> transition_probs_;
|
|
49
|
+
|
|
50
|
+
// emission_probs_[id] : word -> log P(word | tag == id). Words stay
|
|
51
|
+
// string-keyed because the observation vocabulary is open-ended.
|
|
52
|
+
std::vector<std::unordered_map<std::string, double>> emission_probs_;
|
|
46
53
|
};
|
|
47
54
|
|
|
48
55
|
} // namespace phonemis::tagger
|
|
@@ -14,13 +14,13 @@ Tokenizer::Tokenizer(const split::Rules* split_rules,
|
|
|
14
14
|
std::vector<Token>
|
|
15
15
|
Tokenizer::tokenize(std::u32string_view input) const {
|
|
16
16
|
// A resulting list of tokens
|
|
17
|
-
|
|
17
|
+
std::vector<Token> tokens;
|
|
18
18
|
tokens.reserve(input.size() / 5);
|
|
19
19
|
|
|
20
20
|
// A dynamic buffer to collect characters to be processed.
|
|
21
21
|
// Since we try to avoid copying strings, we represent the buffer as a view
|
|
22
22
|
// parametrized by offset (start) and length (len), similarly to string_view.
|
|
23
|
-
|
|
23
|
+
size_t currw_offset = 0, currw_len = 0;
|
|
24
24
|
|
|
25
25
|
for (size_t idx = 0; idx < input.size(); ++idx) {
|
|
26
26
|
char32_t c = input[idx];
|
|
@@ -30,13 +30,13 @@ Tokenizer::tokenize(std::u32string_view input) const {
|
|
|
30
30
|
// and there cannot be 2 or more consecutive white characters.
|
|
31
31
|
|
|
32
32
|
// If we have a pending word, process it
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
if (currw_len > 0) { // equivalent to !curr_word.empty()
|
|
34
|
+
process_phrase(std::u32string_view(input.data() + currw_offset, currw_len), tokens);
|
|
35
|
+
currw_len = 0; // resets the current word view
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
// The right-most token always gets the trailing white space flag, except for the last token in the sequence
|
|
38
|
+
tokens.back().whitespace = true;
|
|
39
|
+
}
|
|
40
40
|
} else {
|
|
41
41
|
currw_offset = currw_len == 0 ? idx : currw_offset;
|
|
42
42
|
currw_len++;
|
|
@@ -97,13 +97,13 @@ void Tokenizer::process_phrase(std::u32string_view word,
|
|
|
97
97
|
|
|
98
98
|
void Tokenizer::process_chunk(std::u32string_view chunk,
|
|
99
99
|
std::vector<Token>& token_vec) const {
|
|
100
|
-
|
|
100
|
+
// Edge case - an empty chunk/word ("")
|
|
101
101
|
if (chunk.empty()) return;
|
|
102
102
|
|
|
103
103
|
// Special word set lookup
|
|
104
104
|
// If an entire chunk is a special word/phrase, we should return it without
|
|
105
105
|
// further divisions.
|
|
106
|
-
|
|
106
|
+
// Note that the lookup is not case sensitive.
|
|
107
107
|
if (exceptions_ && is_exception(strings::to_lower(chunk))) {
|
|
108
108
|
token_vec.push_back({std::u32string(chunk)});
|
|
109
109
|
return;
|
|
@@ -175,8 +175,9 @@ void Tokenizer::process_chunk(std::u32string_view chunk,
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
split::Rule Tokenizer::get_rule(char32_t c) const {
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
// A character has a rule exactly when it is a soft separator; everything
|
|
179
|
+
// else falls back to splitting on both sides.
|
|
180
|
+
return is_soft_separator(c) ? rules_->at(c) : split::Rule::TOTAL_DIVIDE;
|
|
180
181
|
}
|
|
181
182
|
|
|
182
183
|
bool Tokenizer::is_soft_separator(char32_t c) const {
|
|
@@ -1,48 +1,212 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
|
+
#include <phonemis/base/processor/layers/num2word/types.h>
|
|
4
|
+
#include <phonemis/base/processor/common/conditions.h>
|
|
5
|
+
#include <phonemis/base/processor/layers/num2word/notation.h>
|
|
6
|
+
#include <phonemis/base/processor/layers/term2word/types.h>
|
|
3
7
|
#include <phonemis/base/tokenizer/types.h>
|
|
4
8
|
|
|
9
|
+
#include <array>
|
|
5
10
|
#include <cstdint>
|
|
6
11
|
#include <map>
|
|
7
12
|
#include <string>
|
|
13
|
+
#include <string_view>
|
|
8
14
|
#include <unordered_map>
|
|
9
15
|
#include <unordered_set>
|
|
16
|
+
#include <utility>
|
|
10
17
|
#include <vector>
|
|
11
18
|
|
|
12
19
|
namespace phonemis::de::constants {
|
|
13
20
|
|
|
14
21
|
// --- Number to Word Normalization ---
|
|
15
22
|
namespace num2word {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
using ::phonemis::processor::num2word::DateFormat;
|
|
24
|
+
using ::phonemis::processor::num2word::Forms;
|
|
25
|
+
using ::phonemis::processor::num2word::Gender;
|
|
26
|
+
using ::phonemis::processor::num2word::Joiners;
|
|
27
|
+
using ::phonemis::processor::num2word::Keys;
|
|
28
|
+
using ::phonemis::processor::num2word::keys_of;
|
|
29
|
+
using ::phonemis::processor::num2word::Notation;
|
|
30
|
+
using ::phonemis::processor::num2word::SuffixFormat;
|
|
24
31
|
|
|
25
|
-
inline
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{1000000LL, U"Million"},
|
|
29
|
-
{1000000000LL, U"Milliarde"}
|
|
32
|
+
inline constexpr std::array<std::u32string_view, 20> kOnes = {
|
|
33
|
+
U"null", U"eins", U"zwei", U"drei", U"vier", U"fünf", U"sechs", U"sieben", U"acht", U"neun",
|
|
34
|
+
U"zehn", U"elf", U"zwölf", U"dreizehn", U"vierzehn", U"fünfzehn", U"sechzehn", U"siebzehn", U"achtzehn", U"neunzehn"
|
|
30
35
|
};
|
|
31
36
|
|
|
32
|
-
inline
|
|
33
|
-
|
|
37
|
+
inline constexpr std::array<std::u32string_view, 10> kTens = {
|
|
38
|
+
U"", U"", U"zwanzig", U"dreißig", U"vierzig", U"fünfzig", U"sechzig", U"siebzig", U"achtzig", U"neunzig"
|
|
34
39
|
};
|
|
35
40
|
|
|
36
41
|
inline const std::vector<std::u32string> kMonths = {
|
|
37
|
-
U"
|
|
38
|
-
U"Juli",
|
|
42
|
+
U"Januar", U"Februar", U"März", U"April", U"Mai", U"Juni",
|
|
43
|
+
U"Juli", U"August", U"September", U"Oktober", U"November", U"Dezember"
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// Ordinal stems which differ from their cardinals: erst, dritt, siebt, acht
|
|
47
|
+
inline const std::unordered_map<std::u32string, std::u32string> kOrdinalStems = {
|
|
48
|
+
{U"eins", U"ers"}, {U"drei", U"drit"}, {U"sieben", U"sieb"}, {U"acht", U"ach"}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
inline const std::unordered_map<std::u32string, std::u32string> kCurrencies = {
|
|
52
|
+
{U"€", U"Euro"}, {U"Euro", U"Euro"}, {U"$", U"Dollar"}, {U"Dollar", U"Dollar"}, {U"£", U"Pfund"},
|
|
53
|
+
{U"CHF", U"Franken"}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
inline const std::unordered_map<std::u32string, Forms> kScales = {
|
|
57
|
+
{U"Mio.", {U"Million", U"Millionen"}}, {U"Million", {U"Million", U"Millionen"}},
|
|
58
|
+
{U"Millionen", {U"Million", U"Millionen"}}, {U"Mrd.", {U"Milliarde", U"Milliarden"}},
|
|
59
|
+
{U"Milliarde", {U"Milliarde", U"Milliarden"}}, {U"Milliarden", {U"Milliarde", U"Milliarden"}},
|
|
60
|
+
{U"Tsd.", {U"tausend", U"tausend"}}, {U"k", {U"tausend", U"tausend"}}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
inline const std::unordered_map<std::u32string, Forms> kUnits = {
|
|
64
|
+
{U"km", {U"Kilometer", U"Kilometer"}}, {U"m", {U"Meter", U"Meter"}},
|
|
65
|
+
{U"cm", {U"Zentimeter", U"Zentimeter"}}, {U"mm", {U"Millimeter", U"Millimeter"}},
|
|
66
|
+
{U"nm", {U"Nanometer", U"Nanometer"}}, {U"m²", {U"Quadratmeter", U"Quadratmeter"}},
|
|
67
|
+
{U"km²", {U"Quadratkilometer", U"Quadratkilometer"}}, {U"m³", {U"Kubikmeter", U"Kubikmeter"}},
|
|
68
|
+
{U"ha", {U"Hektar", U"Hektar"}}, {U"kg", {U"Kilogramm", U"Kilogramm"}},
|
|
69
|
+
{U"g", {U"Gramm", U"Gramm"}}, {U"mg", {U"Milligramm", U"Milligramm"}},
|
|
70
|
+
{U"t", {U"Tonne", U"Tonnen"}}, {U"l", {U"Liter", U"Liter"}},
|
|
71
|
+
{U"ml", {U"Milliliter", U"Milliliter"}}, {U"TB", {U"Terabyte", U"Terabyte"}},
|
|
72
|
+
{U"GB", {U"Gigabyte", U"Gigabyte"}}, {U"MB", {U"Megabyte", U"Megabyte"}},
|
|
73
|
+
{U"Hz", {U"Hertz", U"Hertz"}}, {U"kHz", {U"Kilohertz", U"Kilohertz"}},
|
|
74
|
+
{U"MHz", {U"Megahertz", U"Megahertz"}}, {U"GHz", {U"Gigahertz", U"Gigahertz"}},
|
|
75
|
+
{U"W", {U"Watt", U"Watt"}}, {U"kW", {U"Kilowatt", U"Kilowatt"}},
|
|
76
|
+
{U"kWh", {U"Kilowattstunde", U"Kilowattstunden"}}, {U"V", {U"Volt", U"Volt"}},
|
|
77
|
+
{U"km/h", {U"Kilometer pro Stunde", U"Kilometer pro Stunde"}}, {U"°C", {U"Grad Celsius", U"Grad Celsius"}},
|
|
78
|
+
{U"°", {U"Grad", U"Grad"}}, {U"h", {U"Stunde", U"Stunden"}},
|
|
79
|
+
{U"Std.", {U"Stunde", U"Stunden"}}, {U"min", {U"Minute", U"Minuten"}},
|
|
80
|
+
{U"Min.", {U"Minute", U"Minuten"}}, {U"s", {U"Sekunde", U"Sekunden"}},
|
|
81
|
+
{U"Sek.", {U"Sekunde", U"Sekunden"}}, {U"ct", {U"Cent", U"Cent"}},
|
|
82
|
+
{U"PS", {U"PS", U"PS"}}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
inline const std::map<std::pair<uint64_t, uint64_t>, std::u32string> kFractions = {
|
|
86
|
+
{{1, 2}, U"ein halb"}, {{1, 3}, U"ein Drittel"}, {{2, 3}, U"zwei Drittel"}, {{1, 4}, U"ein Viertel"},
|
|
87
|
+
{{3, 4}, U"drei Viertel"}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// Determiners after which an ordinal takes a weak ending: am dritten, der dritte (nominative)
|
|
91
|
+
inline const std::unordered_set<std::u32string> kWeak = {
|
|
92
|
+
U"den", U"dem", U"des", U"am", U"im", U"vom", U"zum", U"zur", U"beim", U"ins", U"diesem", U"diesen", U"dieses",
|
|
93
|
+
U"jedem", U"jeden", U"einen", U"einem", U"einer", U"eines", U"keinen", U"keinem", U"keiner", U"keines",
|
|
94
|
+
U"meinen", U"meinem", U"meiner", U"seinen", U"seinem", U"seiner", U"ihren", U"ihrem", U"ihrer", U"unseren",
|
|
95
|
+
U"unserem", U"unserer"
|
|
96
|
+
};
|
|
97
|
+
inline const std::unordered_set<std::u32string> kWeakNominative = {
|
|
98
|
+
U"der", U"die", U"das", U"diese", U"dieser", U"jede", U"jeder", U"jedes", U"eine", U"keine", U"meine", U"seine",
|
|
99
|
+
U"ihre", U"unsere"
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// ein-words, after which an ordinal takes a mixed ending: ein zweiter, ein drittes
|
|
103
|
+
inline const std::unordered_set<std::u32string> kMixed = {
|
|
104
|
+
U"ein", U"kein", U"mein", U"dein", U"sein", U"ihr", U"unser", U"euer"
|
|
39
105
|
};
|
|
40
106
|
|
|
41
|
-
|
|
42
|
-
|
|
107
|
+
// Prepositions by the case they govern
|
|
108
|
+
inline const std::unordered_set<std::u32string> kDative = {
|
|
109
|
+
U"mit", U"nach", U"bei", U"seit", U"von", U"zu", U"aus", U"gegenüber", U"in", U"an", U"auf", U"unter", U"über",
|
|
110
|
+
U"vor", U"hinter", U"neben", U"zwischen", U"ab"
|
|
111
|
+
};
|
|
112
|
+
inline const std::unordered_set<std::u32string> kAccusative = {U"für", U"durch", U"gegen", U"ohne", U"um", U"bis"};
|
|
113
|
+
inline const std::unordered_set<std::u32string> kGenitive = {
|
|
114
|
+
U"wegen", U"während", U"trotz", U"statt", U"innerhalb", U"außerhalb"
|
|
43
115
|
};
|
|
116
|
+
|
|
117
|
+
// Words before a date (am 12. 3.), and before a year (im Jahr 1945, and months)
|
|
118
|
+
inline const std::unordered_set<std::u32string> kDateCues = {U"am", U"vom", U"zum", U"bis", U"ab", U"seit", U"den", U"der"};
|
|
119
|
+
inline const std::unordered_set<std::u32string> kYearCues = {
|
|
120
|
+
U"jahr", U"jahre", U"jahren", U"im", U"seit", U"bis", U"von", U"ab", U"anfang", U"ende", U"mitte", U"sommer",
|
|
121
|
+
U"winter", U"frühjahr", U"herbst", U"frühling", U"anno", U"januar", U"februar", U"märz", U"april", U"mai",
|
|
122
|
+
U"juni", U"juli", U"august", U"september", U"oktober", U"november", U"dezember"
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// Nouns which stay singular after a number: 1500 Stück. Like plural nouns, they make a 4-digit number a count.
|
|
126
|
+
inline const std::unordered_set<std::u32string> kMeasureWords = {
|
|
127
|
+
U"Stück", U"Mal", U"Prozent", U"Grad", U"Euro", U"Dollar", U"Pfund", U"Kilo", U"Gramm", U"Paar", U"Cent",
|
|
128
|
+
U"Franken"
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// Noun gender by ending: the exceptions that matter after numbers (matched as compound endings), then the rules
|
|
132
|
+
inline const std::vector<std::pair<std::u32string, Gender>> kGenders = {
|
|
133
|
+
{U"jahrhundert", Gender::NEUTER}, {U"jahrtausend", Gender::NEUTER}, {U"semester", Gender::NEUTER},
|
|
134
|
+
{U"mitglied", Gender::NEUTER}, {U"kapitel", Gender::NEUTER}, {U"quartal", Gender::NEUTER},
|
|
135
|
+
{U"prozent", Gender::NEUTER}, {U"zimmer", Gender::NEUTER}, {U"rennen", Gender::NEUTER},
|
|
136
|
+
{U"person", Gender::FEMININE}, {U"gramm", Gender::NEUTER}, {U"stück", Gender::NEUTER},
|
|
137
|
+
{U"spiel", Gender::NEUTER}, {U"leben", Gender::NEUTER}, {U"liter", Gender::MASCULINE},
|
|
138
|
+
{U"meter", Gender::MASCULINE}, {U"monat", Gender::MASCULINE}, {U"kunde", Gender::MASCULINE},
|
|
139
|
+
{U"junge", Gender::MASCULINE}, {U"kilo", Gender::NEUTER}, {U"jahr", Gender::NEUTER},
|
|
140
|
+
{U"kind", Gender::NEUTER}, {U"glas", Gender::NEUTER}, {U"haus", Gender::NEUTER},
|
|
141
|
+
{U"land", Gender::NEUTER}, {U"buch", Gender::NEUTER}, {U"bild", Gender::NEUTER},
|
|
142
|
+
{U"ende", Gender::NEUTER}, {U"pfund", Gender::NEUTER}, {U"euro", Gender::MASCULINE},
|
|
143
|
+
{U"name", Gender::MASCULINE}, {U"käse", Gender::MASCULINE}, {U"grad", Gender::MASCULINE},
|
|
144
|
+
{U"mal", Gender::NEUTER}, {U"tor", Gender::NEUTER}, {U"ei", Gender::NEUTER}
|
|
145
|
+
};
|
|
146
|
+
inline const std::vector<std::u32string> kFeminineEndings = {
|
|
147
|
+
U"e", U"ung", U"heit", U"keit", U"schaft", U"ion", U"tät", U"ik", U"ur", U"enz", U"anz", U"ei", U"in", U"ie"
|
|
148
|
+
};
|
|
149
|
+
inline const std::vector<std::u32string> kNeuterEndings = {U"chen", U"lein", U"ment", U"um", U"tum", U"ma", U"o"};
|
|
150
|
+
|
|
151
|
+
// --- Notation: how numbers are written ---
|
|
152
|
+
inline const Notation kNotation = {
|
|
153
|
+
.group_separators = U". \u00a0\u202f", .decimal_separators = U",.", .time_separators = U":.", .time_suffixes = {U"Uhr"},
|
|
154
|
+
.currencies = keys_of(kCurrencies), .scales = keys_of(kScales), .units = keys_of(kUnits), .fractions = true
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// Words between numbers: 3.8.10, 10.0.0.51, 10-15, 1920x1080, 2:1, -5, 2 + 2
|
|
158
|
+
inline const Joiners kJoiners = {
|
|
159
|
+
.point = U"Komma", .dot = U"Punkt", .range = U" bis ", .by = U"mal", .score = U" zu ", .minus = U"minus", .plus = U"plus"
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// 1.5.2024, 1.5., 12. 3.: the year is optional, a dot closes the month
|
|
163
|
+
inline const DateFormat kDateFormat = {
|
|
164
|
+
.separators = U".", .boundaries = U".,", .year_required = false, .closing_separator = true, .spaced = true
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// 90er, 90ern, 90ers
|
|
168
|
+
inline const Keys kDecadeSuffixes = {U"er", U"ern", U"ers"};
|
|
169
|
+
inline const SuffixFormat kDecadeFormat = {.boundaries = U".,-"};
|
|
44
170
|
} // namespace num2word
|
|
45
171
|
|
|
172
|
+
// --- Symbols to Word Normalization ---
|
|
173
|
+
namespace sym2word {
|
|
174
|
+
using ::phonemis::processor::Readings;
|
|
175
|
+
using ::phonemis::processor::after_any;
|
|
176
|
+
|
|
177
|
+
// Words before "§" which take its plural: im § 5 (in dem Paragrafen)
|
|
178
|
+
inline const std::unordered_set<std::u32string> kParagraphPlurals = {
|
|
179
|
+
U"im", U"vom", U"zum", U"beim", U"dem", U"des", U"den"
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
inline const Readings kSymbols = {
|
|
183
|
+
{U"&", {U"und"}}, {U"€", {U"Euro"}}, {U"$", {U"Dollar"}}, {U"£", {U"Pfund"}}, {U"+", {U"plus"}},
|
|
184
|
+
{U"=", {U"gleich"}}, {U"@", {U"at"}}, {U"%", {U"Prozent"}}, {U"°", {U"Grad"}}, {U"#", {U"Hashtag"}},
|
|
185
|
+
{U"²", {U"Quadrat"}}, {U"³", {U"hoch drei"}}, {U"¹", {U"hoch eins"}}, {U"π", {U"Pi"}}, {U"×", {U"mal"}},
|
|
186
|
+
{U"½", {U"ein halb"}}, {U"§§", {U"Paragrafen"}}, {U"§", {{U"Paragrafen", after_any(kParagraphPlurals)}, U"Paragraf"}}
|
|
187
|
+
};
|
|
188
|
+
} // namespace sym2word
|
|
189
|
+
|
|
190
|
+
// --- Terms to Word Normalization ---
|
|
191
|
+
namespace term2word {
|
|
192
|
+
using ::phonemis::processor::before_number;
|
|
193
|
+
using ::phonemis::processor::term2word::Terms;
|
|
194
|
+
|
|
195
|
+
inline const Terms kTerms = {
|
|
196
|
+
.abbreviations = {
|
|
197
|
+
// Before a number only: Abs. 5
|
|
198
|
+
{U"Abs.", {{U"Absatz", before_number}}},
|
|
199
|
+
{U"Nr.", {{U"Nummer", before_number}}},
|
|
200
|
+
{U"S.", {{U"Seite", before_number}}},
|
|
201
|
+
{U"Art.", {{U"Artikel", before_number}}},
|
|
202
|
+
{U"Kap.", {{U"Kapitel", before_number}}},
|
|
203
|
+
{U"ca.", {{U"circa", before_number}}},
|
|
204
|
+
{U"Bd.", {{U"Band", before_number}}},
|
|
205
|
+
},
|
|
206
|
+
.web = {.dot = U"Punkt", .at = U"at", .slash = U"Schrägstrich"}
|
|
207
|
+
};
|
|
208
|
+
} // namespace term2word
|
|
209
|
+
|
|
46
210
|
// --- Tokenization Rules ---
|
|
47
211
|
namespace tokenizer {
|
|
48
212
|
using ::phonemis::tokenizer::split::Rule;
|