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
|
@@ -1,84 +1,206 @@
|
|
|
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::es::constants {
|
|
13
20
|
|
|
14
21
|
// --- Number to Word Normalization ---
|
|
15
22
|
namespace num2word {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{1000000000000LL, U"billones"}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// Currencies (singular and plural forms; Spanish plurals are irregular
|
|
60
|
-
// enough — dólar → dólares, libra → libras — to warrant an explicit table).
|
|
61
|
-
inline const std::unordered_map<char32_t, std::u32string> kCurrencies = {
|
|
62
|
-
{U'$', U"dólar"}, {U'€', U"euro"}, {U'£', U"libra"}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
inline const std::unordered_map<char32_t, std::u32string> kCurrenciesPlural = {
|
|
66
|
-
{U'$', U"dólares"}, {U'€', U"euros"}, {U'£', U"libras"}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// Months (index 1 = January)
|
|
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
|
+
// Up to 29, each a single word
|
|
33
|
+
inline constexpr std::array<std::u32string_view, 30> kOnes = {
|
|
34
|
+
U"cero", U"uno", U"dos", U"tres", U"cuatro", U"cinco",
|
|
35
|
+
U"seis", U"siete", U"ocho", U"nueve", U"diez", U"once",
|
|
36
|
+
U"doce", U"trece", U"catorce", U"quince", U"dieciséis", U"diecisiete",
|
|
37
|
+
U"dieciocho", U"diecinueve", U"veinte", U"veintiuno", U"veintidós", U"veintitrés",
|
|
38
|
+
U"veinticuatro", U"veinticinco", U"veintiséis", U"veintisiete", U"veintiocho", U"veintinueve"
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
inline constexpr std::array<std::u32string_view, 10> kTens = {
|
|
42
|
+
U"", U"", U"", U"treinta", U"cuarenta", U"cincuenta", U"sesenta", U"setenta", U"ochenta", U"noventa"
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
inline constexpr std::array<std::u32string_view, 10> kHundreds = {
|
|
46
|
+
U"", U"ciento", U"doscientos", U"trescientos", U"cuatrocientos",
|
|
47
|
+
U"quinientos", U"seiscientos", U"setecientos", U"ochocientos", U"novecientos"
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// Ordinal stems, completed by -o or -a: centésima trigésima séptima
|
|
51
|
+
inline constexpr std::array<std::u32string_view, 10> kOrdinalOnes = {
|
|
52
|
+
U"", U"primer", U"segund", U"tercer", U"cuart", U"quint", U"sext", U"séptim", U"octav", U"noven"
|
|
53
|
+
};
|
|
54
|
+
inline constexpr std::array<std::u32string_view, 10> kOrdinalTens = {
|
|
55
|
+
U"", U"décim", U"vigésim", U"trigésim", U"cuadragésim",
|
|
56
|
+
U"quincuagésim", U"sexagésim", U"septuagésim", U"octogésim", U"nonagésim"
|
|
57
|
+
};
|
|
58
|
+
inline constexpr std::array<std::u32string_view, 10> kOrdinalHundreds = {
|
|
59
|
+
U"", U"centésim", U"ducentésim", U"tricentésim", U"cuadringentésim",
|
|
60
|
+
U"quingentésim", U"sexcentésim", U"septingentésim", U"octingentésim", U"noningentésim"
|
|
61
|
+
};
|
|
62
|
+
|
|
70
63
|
inline const std::vector<std::u32string> kMonths = {
|
|
71
|
-
U"
|
|
72
|
-
U"julio",
|
|
64
|
+
U"enero", U"febrero", U"marzo", U"abril", U"mayo", U"junio",
|
|
65
|
+
U"julio", U"agosto", U"septiembre", U"octubre", U"noviembre", U"diciembre"
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
inline const std::unordered_map<std::u32string, Forms> kCurrencies = {
|
|
69
|
+
{U"$", {U"dólar", U"dólares"}}, {U"US$", {U"dólar", U"dólares"}}, {U"€", {U"euro", U"euros"}},
|
|
70
|
+
{U"£", {U"libra", U"libras"}}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
inline const std::unordered_map<std::u32string, std::u32string> kScales = {
|
|
74
|
+
{U"millones", U"millones"}, {U"millón", U"millón"}, {U"mil", U"mil"}, {U"k", U"mil"}, {U"K", U"mil"}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
inline const std::unordered_map<std::u32string, Forms> kUnits = {
|
|
78
|
+
{U"km", {U"kilómetro", U"kilómetros"}}, {U"m", {U"metro", U"metros"}},
|
|
79
|
+
{U"cm", {U"centímetro", U"centímetros"}}, {U"mm", {U"milímetro", U"milímetros"}},
|
|
80
|
+
{U"nm", {U"nanómetro", U"nanómetros"}}, {U"m²", {U"metro cuadrado", U"metros cuadrados"}},
|
|
81
|
+
{U"km²", {U"kilómetro cuadrado", U"kilómetros cuadrados"}}, {U"m³", {U"metro cúbico", U"metros cúbicos"}},
|
|
82
|
+
{U"ha", {U"hectárea", U"hectáreas"}}, {U"kg", {U"kilogramo", U"kilogramos"}},
|
|
83
|
+
{U"g", {U"gramo", U"gramos"}}, {U"mg", {U"miligramo", U"miligramos"}},
|
|
84
|
+
{U"t", {U"tonelada", U"toneladas"}}, {U"l", {U"litro", U"litros"}},
|
|
85
|
+
{U"L", {U"litro", U"litros"}}, {U"ml", {U"mililitro", U"mililitros"}},
|
|
86
|
+
{U"TB", {U"terabyte", U"terabytes"}}, {U"GB", {U"gigabyte", U"gigabytes"}},
|
|
87
|
+
{U"MB", {U"megabyte", U"megabytes"}}, {U"KB", {U"kilobyte", U"kilobytes"}},
|
|
88
|
+
{U"Hz", {U"hercio", U"hercios"}}, {U"kHz", {U"kilohercio", U"kilohercios"}},
|
|
89
|
+
{U"MHz", {U"megahercio", U"megahercios"}}, {U"GHz", {U"gigahercio", U"gigahercios"}},
|
|
90
|
+
{U"W", {U"vatio", U"vatios"}}, {U"kW", {U"kilovatio", U"kilovatios"}},
|
|
91
|
+
{U"V", {U"voltio", U"voltios"}}, {U"km/h", {U"kilómetro por hora", U"kilómetros por hora"}},
|
|
92
|
+
{U"MPH", {U"milla por hora", U"millas por hora"}}, {U"mph", {U"milla por hora", U"millas por hora"}},
|
|
93
|
+
{U"°C", {U"grado Celsius", U"grados Celsius"}}, {U"°", {U"grado", U"grados"}}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
inline const std::map<std::pair<uint64_t, uint64_t>, std::u32string> kFractions = {
|
|
97
|
+
{{1, 2}, U"un medio"}, {{1, 3}, U"un tercio"}, {{2, 3}, U"dos tercios"}, {{1, 4}, U"un cuarto"},
|
|
98
|
+
{{3, 4}, U"tres cuartos"}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// Words before the number of a law with its year: Ley 2/2018
|
|
102
|
+
inline const std::unordered_set<std::u32string> kLaws = {
|
|
103
|
+
U"ley", U"decreto", U"legislativo", U"sentencia", U"resolución", U"declaración", U"orden", U"acuerdo",
|
|
104
|
+
U"circular", U"reglamento", U"directiva", U"constitucionalidad", U"expediente", U"norma", U"instrucción"
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// Words before a time with a dot, which make it a time: a las 18.30
|
|
108
|
+
inline const std::unordered_set<std::u32string> kTimeWords = {U"las", U"la", U"a"};
|
|
109
|
+
|
|
110
|
+
// Nouns in -a, -ión, -dad, ... are feminine unless listed below; other feminine nouns are listed
|
|
111
|
+
inline const std::unordered_set<std::u32string> kMasculineInA = {
|
|
112
|
+
U"día", U"mapa", U"problema", U"sistema", U"programa", U"tema", U"idioma", U"clima", U"planeta", U"poema",
|
|
113
|
+
U"dilema", U"drama", U"esquema", U"sofá", U"papá", U"cometa", U"fantasma", U"panorama", U"diagrama", U"teorema"
|
|
114
|
+
};
|
|
115
|
+
inline const std::unordered_set<std::u32string> kFeminineNouns = {
|
|
116
|
+
U"vez", U"veces", U"mano", U"foto", U"moto", U"radio", U"mujer", U"flor", U"noche", U"clase", U"parte",
|
|
117
|
+
U"gente", U"leche", U"muerte", U"suerte", U"calle", U"carne", U"red", U"voz", U"luz", U"paz", U"ley", U"piel",
|
|
118
|
+
U"fase", U"base", U"frase", U"nube", U"llave", U"fuente", U"mente", U"torre", U"tarde", U"serie", U"especie",
|
|
119
|
+
U"superficie", U"imagen", U"orden", U"edición"
|
|
120
|
+
};
|
|
121
|
+
inline const std::vector<std::u32string> kFeminineEndings = {U"a", U"ión", U"dad", U"tad", U"tud", U"umbre", U"sis", U"itis"};
|
|
122
|
+
|
|
123
|
+
// Words after a number which are not the noun it counts
|
|
124
|
+
inline const std::unordered_set<std::u32string> kStopWords = {
|
|
125
|
+
U"de", U"del", U"en", U"con", U"por", U"para", U"sin", U"que", U"y", U"e", U"o", U"u", U"a", U"al", U"los",
|
|
126
|
+
U"las", U"el", U"la", U"lo", U"un", U"una", U"unos", U"unas", U"es", U"son", U"era", U"sea", U"pero", U"como",
|
|
127
|
+
U"más", U"menos", U"hasta", U"desde", U"entre", U"sobre", U"contra", U"hacia", U"tras", U"según", U"durante",
|
|
128
|
+
U"mediante", U"cada", U"toda", U"todas", U"todo", U"todos", U"esta", U"estas", U"este", U"estos", U"esa",
|
|
129
|
+
U"esas", U"ese", U"esos", U"otra", U"otras", U"otro", U"otros", U"nada", U"ya", U"ahora", U"cuando", U"donde",
|
|
130
|
+
U"mientras", U"muy", U"casi", U"también", U"así", U"se", U"le", U"les", U"me", U"te", U"nos"
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// --- Notation: how numbers are written ---
|
|
134
|
+
inline const Notation kNotation = {
|
|
135
|
+
.group_separators = U".,", .decimal_separators = U".,", .time_separators = U":.", .time_suffixes = {U"h", U"hrs"},
|
|
136
|
+
.currencies = keys_of(kCurrencies), .scales = keys_of(kScales), .units = keys_of(kUnits), .fractions = true
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// Words between numbers: 3.8.10, 10.0.0.51, 10-15, 1920x1080, 2:1, -5, 2 + 2
|
|
140
|
+
inline const Joiners kJoiners = {
|
|
141
|
+
.point = U"punto", .dot = U"punto", .range = U"-", .by = U"por", .score = U" a ", .minus = U"menos", .plus = U"más"
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// 14/07/2023, 31/12/99
|
|
145
|
+
inline const DateFormat kDateFormat = {};
|
|
146
|
+
|
|
147
|
+
// 600-123-456, 600 123 456 (after a word of kPhoneWords)
|
|
148
|
+
inline const std::vector<PhoneFormat> kPhoneFormats = {
|
|
149
|
+
{.groups = {{3, 3}, {3, 3}, {3, 3}}, .separators = U"-", .boundaries = U".,-", .closing = U"-"},
|
|
150
|
+
{.groups = {{3, 3}, {3, 3}, {3, 3}}, .separators = U" ", .boundaries = U".,-", .closing = U"-"}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
// Words before a phone number written with spaces, which else reads as numbers: llame al 600 123 456
|
|
154
|
+
inline const std::unordered_set<std::u32string> kPhoneWords = {
|
|
155
|
+
U"al", U"teléfono", U"tel", U"móvil", U"número", U"llame", U"llamar", U"fax", U"whatsapp", U"contacto"
|
|
73
156
|
};
|
|
74
157
|
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
inline const
|
|
78
|
-
|
|
158
|
+
// 1º, 2 ª: a sign, possibly after a space
|
|
159
|
+
inline const Keys kOrdinalSigns = {U"º", U"ª"};
|
|
160
|
+
inline const SuffixFormat kOrdinalSignFormat = {.space = true, .word_end = false};
|
|
161
|
+
|
|
162
|
+
// 1er, 3ero, 2da, 5ta
|
|
163
|
+
inline const Keys kOrdinalSuffixes = {
|
|
164
|
+
U"er", U"ero", U"era", U"ro", U"ra", U"do", U"da", U"to", U"ta", U"vo", U"va", U"mo", U"ma", U"no", U"na"
|
|
79
165
|
};
|
|
166
|
+
|
|
167
|
+
// 80s, 90's
|
|
168
|
+
inline const Keys kDecadeSuffixes = {U"s"};
|
|
169
|
+
inline const SuffixFormat kDecadeFormat = {.apostrophes = true, .boundaries = U".,-"};
|
|
80
170
|
} // namespace num2word
|
|
81
171
|
|
|
172
|
+
// --- Symbols to Word Normalization ---
|
|
173
|
+
namespace sym2word {
|
|
174
|
+
using ::phonemis::processor::Readings;
|
|
175
|
+
using ::phonemis::processor::after_name;
|
|
176
|
+
|
|
177
|
+
// "+" is "plus" after a name (Google+), "más" otherwise (C++)
|
|
178
|
+
inline const Readings kSymbols = {
|
|
179
|
+
{U"&", {U"y"}}, {U"=", {U"igual a"}}, {U"@", {U"arroba"}}, {U"%", {U"por ciento"}}, {U"°", {U"grados"}},
|
|
180
|
+
{U"#", {U"numeral"}}, {U"²", {U"al cuadrado"}}, {U"³", {U"al cubo"}}, {U"π", {U"pi"}}, {U"×", {U"por"}},
|
|
181
|
+
{U"€", {U"euros"}}, {U"$", {U"dólares"}}, {U"£", {U"libras"}}, {U"+", {{U"plus", after_name}, U"más"}}
|
|
182
|
+
};
|
|
183
|
+
} // namespace sym2word
|
|
184
|
+
|
|
185
|
+
// --- Terms to Word Normalization ---
|
|
186
|
+
namespace term2word {
|
|
187
|
+
using ::phonemis::processor::before_number;
|
|
188
|
+
using ::phonemis::processor::term2word::Terms;
|
|
189
|
+
|
|
190
|
+
inline const Terms kTerms = {
|
|
191
|
+
.abbreviations = {
|
|
192
|
+
// Before a number only: Nº 5
|
|
193
|
+
{U"Nº", {{U"número", before_number}}},
|
|
194
|
+
{U"nº", {{U"número", before_number}}},
|
|
195
|
+
{U"N°", {{U"número", before_number}}},
|
|
196
|
+
{U"núm.", {{U"número", before_number}}},
|
|
197
|
+
{U"pág.", {{U"página", before_number}}},
|
|
198
|
+
{U"art.", {{U"artículo", before_number}}},
|
|
199
|
+
},
|
|
200
|
+
.web = {.dot = U"punto", .at = U"arroba", .slash = U"barra"}
|
|
201
|
+
};
|
|
202
|
+
} // namespace term2word
|
|
203
|
+
|
|
82
204
|
// --- Tokenization Rules ---
|
|
83
205
|
namespace tokenizer {
|
|
84
206
|
using ::phonemis::tokenizer::split::Rule;
|