react-native-executorch 0.10.6 → 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/lib/module/fetcher/telemetry.js +1 -1
- package/package.json +1 -1
- package/react-native-executorch.podspec +2 -0
- package/src/fetcher/telemetry.ts +1 -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
|
@@ -1,77 +1,157 @@
|
|
|
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::it::constants {
|
|
13
20
|
|
|
14
21
|
// --- Number to Word Normalization ---
|
|
15
22
|
namespace num2word {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
using ::phonemis::processor::num2word::DateFormat;
|
|
24
|
+
using ::phonemis::processor::num2word::Forms;
|
|
25
|
+
using ::phonemis::processor::num2word::Joiners;
|
|
26
|
+
using ::phonemis::processor::num2word::Keys;
|
|
27
|
+
using ::phonemis::processor::num2word::keys_of;
|
|
28
|
+
using ::phonemis::processor::num2word::Notation;
|
|
29
|
+
using ::phonemis::processor::num2word::PhoneFormat;
|
|
30
|
+
using ::phonemis::processor::num2word::SuffixFormat;
|
|
31
|
+
|
|
32
|
+
inline constexpr std::array<std::u32string_view, 20> kOnes = {
|
|
33
|
+
U"zero", U"uno", U"due", U"tre", U"quattro", U"cinque", U"sei",
|
|
34
|
+
U"sette", U"otto", U"nove", U"dieci", U"undici", U"dodici", U"tredici",
|
|
35
|
+
U"quattordici", U"quindici", U"sedici", U"diciassette", U"diciotto", U"diciannove"
|
|
26
36
|
};
|
|
27
37
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
inline const std::unordered_map<int32_t, std::u32string> kOrdinals = {
|
|
31
|
-
{1, U"primo"}, {2, U"secondo"}, {3, U"terzo"}, {4, U"quarto"}, {5, U"quinto"},
|
|
32
|
-
{6, U"sesto"}, {7, U"settimo"}, {8, U"ottavo"}, {9, U"nono"}, {10, U"decimo"}
|
|
38
|
+
inline constexpr std::array<std::u32string_view, 10> kTens = {
|
|
39
|
+
U"", U"", U"venti", U"trenta", U"quaranta", U"cinquanta", U"sessanta", U"settanta", U"ottanta", U"novanta"
|
|
33
40
|
};
|
|
34
41
|
|
|
35
|
-
//
|
|
36
|
-
inline
|
|
37
|
-
|
|
38
|
-
{1000LL, U"mille"},
|
|
39
|
-
{1000000LL, U"milione"},
|
|
40
|
-
{1000000000LL, U"miliardo"}
|
|
42
|
+
// Ordinals up to ten; later ones are the cardinal with -esimo
|
|
43
|
+
inline constexpr std::array<std::u32string_view, 11> kOrdinals = {
|
|
44
|
+
U"", U"primo", U"secondo", U"terzo", U"quarto", U"quinto", U"sesto", U"settimo", U"ottavo", U"nono", U"decimo"
|
|
41
45
|
};
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
{100LL, U"cento"},
|
|
47
|
-
{1000LL, U"mila"},
|
|
48
|
-
{1000000LL, U"milioni"},
|
|
49
|
-
{1000000000LL, U"miliardi"}
|
|
47
|
+
inline const std::vector<std::u32string> kMonths = {
|
|
48
|
+
U"gennaio", U"febbraio", U"marzo", U"aprile", U"maggio", U"giugno",
|
|
49
|
+
U"luglio", U"agosto", U"settembre", U"ottobre", U"novembre", U"dicembre"
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
inline const std::unordered_map<char32_t, std::u32string> kCurrencies = {
|
|
55
|
-
{U'$', U"dollaro"}, {U'€', U"euro"}, {U'£', U"sterlina"}
|
|
52
|
+
inline const std::unordered_map<std::u32string, Forms> kCurrencies = {
|
|
53
|
+
{U"€", {U"euro", U"euro"}}, {U"$", {U"dollaro", U"dollari"}}, {U"£", {U"sterlina", U"sterline"}}
|
|
56
54
|
};
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
// Most scales are written as the word they are read with: 3 milioni
|
|
57
|
+
inline const std::unordered_map<std::u32string, Forms> kScales = {
|
|
58
|
+
{U"mila", {U"mila", U"mila"}}, {U"k", {U"mila", U"mila"}}, {U"K", {U"mila", U"mila"}},
|
|
59
|
+
{U"milione", {U"milione", U"milione"}}, {U"milioni", {U"milioni", U"milioni"}},
|
|
60
|
+
{U"miliardo", {U"miliardo", U"miliardo"}}, {U"miliardi", {U"miliardi", U"miliardi"}},
|
|
61
|
+
{U"mln", {U"milione", U"milioni"}}, {U"mld", {U"miliardo", U"miliardi"}}
|
|
60
62
|
};
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
U"",
|
|
65
|
-
U"
|
|
64
|
+
inline const std::unordered_map<std::u32string, Forms> kUnits = {
|
|
65
|
+
{U"km", {U"chilometro", U"chilometri"}}, {U"m", {U"metro", U"metri"}},
|
|
66
|
+
{U"cm", {U"centimetro", U"centimetri"}}, {U"mm", {U"millimetro", U"millimetri"}},
|
|
67
|
+
{U"m²", {U"metro quadro", U"metri quadri"}}, {U"m2", {U"metro quadro", U"metri quadri"}},
|
|
68
|
+
{U"km²", {U"chilometro quadrato", U"chilometri quadrati"}}, {U"m³", {U"metro cubo", U"metri cubi"}},
|
|
69
|
+
{U"kg", {U"chilo", U"chili"}}, {U"g", {U"grammo", U"grammi"}},
|
|
70
|
+
{U"mg", {U"milligrammo", U"milligrammi"}}, {U"l", {U"litro", U"litri"}},
|
|
71
|
+
{U"ml", {U"millilitro", U"millilitri"}}, {U"TB", {U"terabyte", U"terabyte"}},
|
|
72
|
+
{U"GB", {U"giga", U"giga"}}, {U"MB", {U"mega", U"mega"}},
|
|
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"kilowattora", U"kilowattora"}}, {U"V", {U"volt", U"volt"}},
|
|
77
|
+
{U"km/h", {U"chilometro orario", U"chilometri orari"}}, {U"°C", {U"grado", U"gradi"}},
|
|
78
|
+
{U"°", {U"grado", U"gradi"}}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
inline const std::map<std::pair<uint64_t, uint64_t>, std::u32string> kFractions = {
|
|
82
|
+
{{1, 2}, U"un mezzo"}, {{1, 3}, U"un terzo"}, {{2, 3}, U"due terzi"}, {{1, 4}, U"un quarto"},
|
|
83
|
+
{{3, 4}, U"tre quarti"}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// Words before a time with a dot, which make it a time: alle 21.30
|
|
87
|
+
inline const std::unordered_set<std::u32string> kTimeWords = {
|
|
88
|
+
U"alle", U"ore", U"dalle", U"le", U"verso", U"entro", U"per"
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// --- Notation: how numbers are written ---
|
|
92
|
+
inline const Notation kNotation = {
|
|
93
|
+
.group_separators = U".", .decimal_separators = U",.", .time_separators = U":.",
|
|
94
|
+
.currencies = keys_of(kCurrencies), .scales = keys_of(kScales), .units = keys_of(kUnits), .fractions = true
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// Words between numbers: 3.8.10, 10.0.0.51, 10-15, 1920x1080, 2:1, -5, 2 + 2
|
|
98
|
+
inline const Joiners kJoiners = {
|
|
99
|
+
.point = U"punto", .dot = U"punto", .range = U"-", .by = U"per", .score = U" a ", .minus = U"meno", .plus = U"più"
|
|
66
100
|
};
|
|
67
101
|
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
102
|
+
// 24/03/2022
|
|
103
|
+
inline const DateFormat kDateFormat = {.boundaries = U".,/-"};
|
|
104
|
+
|
|
105
|
+
// 333 1234567, 06 1234 5678, 06 12345678
|
|
106
|
+
inline const std::vector<PhoneFormat> kPhoneFormats = {
|
|
107
|
+
{.groups = {{3, 3}, {6, 7}}, .separators = U" "},
|
|
108
|
+
{.groups = {{2, 4}, {3, 4}, {4, 4}}, .separators = U" ", .leading_zero = true},
|
|
109
|
+
{.groups = {{2, 4}, {6, 8}}, .separators = U" ", .leading_zero = true}
|
|
72
110
|
};
|
|
111
|
+
|
|
112
|
+
// 1º, 2 ª: a sign, possibly after a space
|
|
113
|
+
inline const Keys kOrdinalSigns = {U"º", U"ª"};
|
|
114
|
+
inline const SuffixFormat kOrdinalSignFormat = {.space = true};
|
|
115
|
+
|
|
116
|
+
// 21esimo, 33esima
|
|
117
|
+
inline const Keys kOrdinalSuffixes = {U"esimo", U"esima", U"esimi", U"esime"};
|
|
73
118
|
} // namespace num2word
|
|
74
119
|
|
|
120
|
+
// --- Symbols to Word Normalization ---
|
|
121
|
+
namespace sym2word {
|
|
122
|
+
using ::phonemis::processor::Readings;
|
|
123
|
+
|
|
124
|
+
// "&" only joins English names: AT&T, R&B
|
|
125
|
+
inline const Readings kSymbols = {
|
|
126
|
+
{U"&", {U"and"}}, {U"+", {U"più"}}, {U"=", {U"uguale a"}}, {U"@", {U"chiocciola"}}, {U"%", {U"per cento"}},
|
|
127
|
+
{U"°", {U"gradi"}}, {U"#", {U"hashtag"}}, {U"²", {U"al quadrato"}}, {U"³", {U"al cubo"}}, {U"π", {U"pi greco"}},
|
|
128
|
+
{U"×", {U"per"}}, {U"€", {U"euro"}}, {U"$", {U"dollari"}}, {U"£", {U"sterline"}}, {U"§", {U"paragrafo"}}
|
|
129
|
+
};
|
|
130
|
+
} // namespace sym2word
|
|
131
|
+
|
|
132
|
+
// --- Terms to Word Normalization ---
|
|
133
|
+
namespace term2word {
|
|
134
|
+
using ::phonemis::processor::before_number;
|
|
135
|
+
using ::phonemis::processor::term2word::Terms;
|
|
136
|
+
|
|
137
|
+
inline const Terms kTerms = {
|
|
138
|
+
.abbreviations = {
|
|
139
|
+
// Before a number only: n. 5
|
|
140
|
+
{U"n.", {{U"numero", before_number}}},
|
|
141
|
+
{U"N.", {{U"numero", before_number}}},
|
|
142
|
+
{U"nr.", {{U"numero", before_number}}},
|
|
143
|
+
{U"n°", {{U"numero", before_number}}},
|
|
144
|
+
{U"N°", {{U"numero", before_number}}},
|
|
145
|
+
{U"art.", {{U"articolo", before_number}}},
|
|
146
|
+
{U"Art.", {{U"articolo", before_number}}},
|
|
147
|
+
{U"pag.", {{U"pagina", before_number}}},
|
|
148
|
+
{U"cap.", {{U"capitolo", before_number}}},
|
|
149
|
+
{U"§", {{U"paragrafo", before_number}}},
|
|
150
|
+
},
|
|
151
|
+
.web = {.dot = U"punto", .at = U"chiocciola", .slash = U"slash"}
|
|
152
|
+
};
|
|
153
|
+
} // namespace term2word
|
|
154
|
+
|
|
75
155
|
// --- Tokenization Rules ---
|
|
76
156
|
namespace tokenizer {
|
|
77
157
|
using ::phonemis::tokenizer::split::Rule;
|