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.
Files changed (237) hide show
  1. package/lib/module/fetcher/telemetry.js +1 -1
  2. package/package.json +1 -1
  3. package/react-native-executorch.podspec +2 -0
  4. package/src/fetcher/telemetry.ts +1 -1
  5. package/third-party/common/phonemis/CMakeLists.txt +70 -14
  6. package/third-party/common/phonemis/README.md +183 -33
  7. package/third-party/common/phonemis/THIRD_PARTY_NOTICES.md +57 -0
  8. package/third-party/common/phonemis/knowledge/code_style.md +642 -0
  9. package/third-party/common/phonemis/licenses/Unicode-3.0.txt +39 -0
  10. package/third-party/common/phonemis/licenses/misaki-Apache-2.0.txt +201 -0
  11. package/third-party/common/phonemis/licenses/nlohmann-json-MIT.txt +21 -0
  12. package/third-party/common/phonemis/licenses/xsimd-BSD-3-Clause.txt +29 -0
  13. package/third-party/common/phonemis/src/phonemis/base/config.h +6 -0
  14. package/third-party/common/phonemis/src/phonemis/base/ipipeline.cpp +75 -0
  15. package/third-party/common/phonemis/src/phonemis/base/ipipeline.h +21 -0
  16. package/third-party/common/phonemis/src/phonemis/base/phonemizer/constants.h +2 -5
  17. package/third-party/common/phonemis/src/phonemis/base/phonemizer/lexicon_phonemizer.cpp +3 -4
  18. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/neural_phonemizer.cpp +17 -8
  19. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/neural_phonemizer.h +4 -0
  20. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/tokenizer.cpp +21 -6
  21. package/third-party/common/phonemis/src/phonemis/base/phonemizer/nn/tokenizer.h +13 -4
  22. package/third-party/common/phonemis/src/phonemis/base/pipeline.cpp +8 -0
  23. package/third-party/common/phonemis/src/phonemis/base/pipeline.h +19 -0
  24. package/third-party/common/phonemis/src/phonemis/base/processor/common/conditions.cpp +37 -0
  25. package/third-party/common/phonemis/src/phonemis/base/processor/common/conditions.h +45 -0
  26. package/third-party/common/phonemis/src/phonemis/base/processor/common/constants.h +10 -0
  27. package/third-party/common/phonemis/src/phonemis/base/processor/common/context.cpp +105 -0
  28. package/third-party/common/phonemis/src/phonemis/base/processor/common/context.h +49 -0
  29. package/third-party/common/phonemis/src/phonemis/base/processor/common/document.cpp +173 -0
  30. package/third-party/common/phonemis/src/phonemis/base/processor/common/document.h +67 -0
  31. package/third-party/common/phonemis/src/phonemis/base/processor/common/text.cpp +75 -0
  32. package/third-party/common/phonemis/src/phonemis/base/processor/common/text.h +60 -0
  33. package/third-party/common/phonemis/src/phonemis/base/processor/common/types.h +18 -0
  34. package/third-party/common/phonemis/src/phonemis/base/processor/config.h +53 -0
  35. package/third-party/common/phonemis/src/phonemis/base/processor/layer.h +9 -7
  36. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/constants.h +20 -0
  37. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/layer.cpp +89 -0
  38. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/layer.h +35 -0
  39. package/third-party/common/phonemis/src/phonemis/base/processor/layers/normalize/types.h +16 -0
  40. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/kind.h +40 -0
  41. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/layer.h +382 -0
  42. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/notation.h +30 -0
  43. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/numerals.cpp +51 -0
  44. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/numerals.h +31 -0
  45. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern.h +30 -0
  46. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern_set.cpp +17 -0
  47. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/pattern_set.h +31 -0
  48. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/patterns.cpp +811 -0
  49. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/patterns.h +285 -0
  50. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/primitives.cpp +64 -0
  51. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/primitives.h +23 -0
  52. package/third-party/common/phonemis/src/phonemis/base/processor/layers/num2word/types.h +94 -0
  53. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sanitizer/layer.cpp +19 -0
  54. package/third-party/common/phonemis/src/phonemis/base/processor/{sanitizer_layer.h → layers/sanitizer/layer.h} +8 -8
  55. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sym2word/layer.cpp +65 -0
  56. package/third-party/common/phonemis/src/phonemis/base/processor/layers/sym2word/layer.h +29 -0
  57. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/layer.cpp +170 -0
  58. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/layer.h +40 -0
  59. package/third-party/common/phonemis/src/phonemis/base/processor/layers/term2word/types.h +25 -0
  60. package/third-party/common/phonemis/src/phonemis/base/processor/layers/trim/layer.cpp +47 -0
  61. package/third-party/common/phonemis/src/phonemis/base/processor/layers/trim/layer.h +19 -0
  62. package/third-party/common/phonemis/src/phonemis/base/processor/preprocessor.cpp +60 -0
  63. package/third-party/common/phonemis/src/phonemis/base/processor/preprocessor.h +45 -0
  64. package/third-party/common/phonemis/src/phonemis/base/processor/processor.cpp +6 -7
  65. package/third-party/common/phonemis/src/phonemis/base/processor/processor.h +14 -10
  66. package/third-party/common/phonemis/src/phonemis/base/tagger/hmm_tagger.cpp +89 -52
  67. package/third-party/common/phonemis/src/phonemis/base/tagger/hmm_tagger.h +16 -9
  68. package/third-party/common/phonemis/src/phonemis/base/tokenizer/tokenizer.cpp +13 -12
  69. package/third-party/common/phonemis/src/phonemis/lang/de/constants.h +183 -19
  70. package/third-party/common/phonemis/src/phonemis/lang/de/num2word.cpp +355 -309
  71. package/third-party/common/phonemis/src/phonemis/lang/de/num2word.h +42 -17
  72. package/third-party/common/phonemis/src/phonemis/lang/de/patterns.cpp +56 -0
  73. package/third-party/common/phonemis/src/phonemis/lang/de/patterns.h +15 -0
  74. package/third-party/common/phonemis/src/phonemis/lang/de/pipeline.h +3 -3
  75. package/third-party/common/phonemis/src/phonemis/lang/en/constants.h +181 -30
  76. package/third-party/common/phonemis/src/phonemis/lang/en/hmm_tagger.cpp +5 -7
  77. package/third-party/common/phonemis/src/phonemis/lang/en/num2word.cpp +232 -135
  78. package/third-party/common/phonemis/src/phonemis/lang/en/num2word.h +41 -16
  79. package/third-party/common/phonemis/src/phonemis/lang/en/pipeline.h +3 -10
  80. package/third-party/common/phonemis/src/phonemis/lang/es/constants.h +182 -60
  81. package/third-party/common/phonemis/src/phonemis/lang/es/num2word.cpp +247 -212
  82. package/third-party/common/phonemis/src/phonemis/lang/es/num2word.h +38 -18
  83. package/third-party/common/phonemis/src/phonemis/lang/es/patterns.cpp +50 -0
  84. package/third-party/common/phonemis/src/phonemis/lang/es/patterns.h +15 -0
  85. package/third-party/common/phonemis/src/phonemis/lang/es/pipeline.h +3 -3
  86. package/third-party/common/phonemis/src/phonemis/lang/fr/constants.h +152 -26
  87. package/third-party/common/phonemis/src/phonemis/lang/fr/num2word.cpp +252 -179
  88. package/third-party/common/phonemis/src/phonemis/lang/fr/num2word.h +38 -15
  89. package/third-party/common/phonemis/src/phonemis/lang/fr/patterns.cpp +83 -0
  90. package/third-party/common/phonemis/src/phonemis/lang/fr/patterns.h +15 -0
  91. package/third-party/common/phonemis/src/phonemis/lang/fr/pipeline.h +3 -3
  92. package/third-party/common/phonemis/src/phonemis/lang/hi/constants.h +62 -10
  93. package/third-party/common/phonemis/src/phonemis/lang/hi/num2word.cpp +74 -123
  94. package/third-party/common/phonemis/src/phonemis/lang/hi/num2word.h +27 -16
  95. package/third-party/common/phonemis/src/phonemis/lang/hi/pipeline.h +5 -3
  96. package/third-party/common/phonemis/src/phonemis/lang/it/constants.h +122 -42
  97. package/third-party/common/phonemis/src/phonemis/lang/it/num2word.cpp +200 -207
  98. package/third-party/common/phonemis/src/phonemis/lang/it/num2word.h +30 -18
  99. package/third-party/common/phonemis/src/phonemis/lang/it/patterns.cpp +25 -0
  100. package/third-party/common/phonemis/src/phonemis/lang/it/patterns.h +15 -0
  101. package/third-party/common/phonemis/src/phonemis/lang/it/pipeline.h +3 -3
  102. package/third-party/common/phonemis/src/phonemis/lang/pl/constants.h +346 -77
  103. package/third-party/common/phonemis/src/phonemis/lang/pl/num2word.cpp +631 -246
  104. package/third-party/common/phonemis/src/phonemis/lang/pl/num2word.h +47 -15
  105. package/third-party/common/phonemis/src/phonemis/lang/pl/pipeline.h +6 -6
  106. package/third-party/common/phonemis/src/phonemis/lang/pt/constants.h +201 -0
  107. package/third-party/common/phonemis/src/phonemis/lang/pt/num2word.cpp +365 -0
  108. package/third-party/common/phonemis/src/phonemis/lang/pt/num2word.h +53 -0
  109. package/third-party/common/phonemis/src/phonemis/lang/pt/pipeline.h +4 -2
  110. package/third-party/common/phonemis/src/phonemis/main.cpp +42 -11
  111. package/third-party/common/phonemis/src/phonemis/protophone/meta.h +24 -0
  112. package/third-party/common/phonemis/src/phonemis/protophone/numeric.h +26 -0
  113. package/third-party/common/phonemis/src/phonemis/protophone/protophone.cpp +525 -0
  114. package/third-party/common/phonemis/src/phonemis/protophone/protophone.h +80 -0
  115. package/third-party/common/phonemis/src/phonemis/protophone/tensor.h +76 -0
  116. package/third-party/common/phonemis/src/phonemis/protophone/tensor_utils.h +89 -0
  117. package/third-party/common/phonemis/src/phonemis/protophone/tensor_view.h +125 -0
  118. package/third-party/common/phonemis/src/phonemis/protophone/types.h +43 -0
  119. package/third-party/common/phonemis/src/phonemis/utils/strings.h +20 -14
  120. package/third-party/common/phonemis/src/phonemis/utils/unicode.h +15 -1
  121. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_arithmetic.hpp +267 -0
  122. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_bit.hpp +232 -0
  123. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_cast.hpp +43 -0
  124. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_complex.hpp +112 -0
  125. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_details.hpp +386 -0
  126. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_logical.hpp +240 -0
  127. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_math.hpp +2601 -0
  128. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_memory.hpp +1006 -0
  129. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_rounding.hpp +72 -0
  130. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_swizzle.hpp +260 -0
  131. package/third-party/common/phonemis/src/third-party/xsimd/arch/common/xsimd_common_trigo.hpp +996 -0
  132. package/third-party/common/phonemis/src/third-party/xsimd/arch/utils/shifts.hpp +82 -0
  133. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx.hpp +2111 -0
  134. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx2.hpp +1591 -0
  135. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx2_128.hpp +170 -0
  136. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512bw.hpp +724 -0
  137. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512cd.hpp +28 -0
  138. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512dq.hpp +270 -0
  139. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512er.hpp +17 -0
  140. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512f.hpp +2919 -0
  141. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512ifma.hpp +17 -0
  142. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512pf.hpp +17 -0
  143. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vbmi.hpp +76 -0
  144. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vbmi2.hpp +130 -0
  145. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vnni_avx512bw.hpp +17 -0
  146. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx512vnni_avx512vbmi2.hpp +17 -0
  147. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avx_128.hpp +164 -0
  148. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_avxvnni.hpp +17 -0
  149. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_common.hpp +26 -0
  150. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_common_fwd.hpp +127 -0
  151. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_constants.hpp +393 -0
  152. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_emulated.hpp +787 -0
  153. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_avx.hpp +93 -0
  154. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_avx2.hpp +46 -0
  155. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma3_sse.hpp +97 -0
  156. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_fma4.hpp +92 -0
  157. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_i8mm_neon64.hpp +17 -0
  158. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_isa.hpp +148 -0
  159. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_neon.hpp +3580 -0
  160. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_neon64.hpp +1614 -0
  161. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_rvv.hpp +1515 -0
  162. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_scalar.hpp +1210 -0
  163. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse2.hpp +2333 -0
  164. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse3.hpp +66 -0
  165. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse4_1.hpp +510 -0
  166. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sse4_2.hpp +44 -0
  167. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_ssse3.hpp +186 -0
  168. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_sve.hpp +1186 -0
  169. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_vsx.hpp +947 -0
  170. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_vxe.hpp +787 -0
  171. package/third-party/common/phonemis/src/third-party/xsimd/arch/xsimd_wasm.hpp +1819 -0
  172. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_arch.hpp +242 -0
  173. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_config.hpp +633 -0
  174. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features.hpp +50 -0
  175. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_arm.hpp +132 -0
  176. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_ppc.hpp +54 -0
  177. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_riscv.hpp +95 -0
  178. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_s390x.hpp +56 -0
  179. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpu_features_x86.hpp +1121 -0
  180. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_cpuid.hpp +144 -0
  181. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_getauxval.hpp +159 -0
  182. package/third-party/common/phonemis/src/third-party/xsimd/config/xsimd_macros.hpp +78 -0
  183. package/third-party/common/phonemis/src/third-party/xsimd/math/xsimd_rem_pio2.hpp +707 -0
  184. package/third-party/common/phonemis/src/third-party/xsimd/memory/xsimd_aligned_allocator.hpp +349 -0
  185. package/third-party/common/phonemis/src/third-party/xsimd/memory/xsimd_alignment.hpp +102 -0
  186. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_all_registers.hpp +57 -0
  187. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_api.hpp +3106 -0
  188. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx2_register.hpp +57 -0
  189. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512bw_register.hpp +51 -0
  190. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512cd_register.hpp +51 -0
  191. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512dq_register.hpp +51 -0
  192. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512er_register.hpp +51 -0
  193. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512f_register.hpp +77 -0
  194. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512ifma_register.hpp +51 -0
  195. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512pf_register.hpp +51 -0
  196. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vbmi2_register.hpp +51 -0
  197. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vbmi_register.hpp +51 -0
  198. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vnni_avx512bw_register.hpp +54 -0
  199. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx512vnni_avx512vbmi2_register.hpp +53 -0
  200. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avx_register.hpp +79 -0
  201. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_avxvnni_register.hpp +44 -0
  202. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch.hpp +1666 -0
  203. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch_constant.hpp +572 -0
  204. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_batch_fwd.hpp +41 -0
  205. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_common_arch.hpp +49 -0
  206. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_emulated_register.hpp +80 -0
  207. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_avx2_register.hpp +50 -0
  208. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_avx_register.hpp +50 -0
  209. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma3_sse_register.hpp +50 -0
  210. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_fma4_register.hpp +50 -0
  211. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_i8mm_neon64_register.hpp +55 -0
  212. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_neon64_register.hpp +55 -0
  213. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_neon_register.hpp +130 -0
  214. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_register.hpp +96 -0
  215. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_rvv_register.hpp +491 -0
  216. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse2_register.hpp +59 -0
  217. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse3_register.hpp +49 -0
  218. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse4_1_register.hpp +48 -0
  219. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sse4_2_register.hpp +48 -0
  220. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_ssse3_register.hpp +48 -0
  221. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_sve_register.hpp +216 -0
  222. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_traits.hpp +409 -0
  223. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_utils.hpp +462 -0
  224. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_vsx_register.hpp +84 -0
  225. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_vxe_register.hpp +86 -0
  226. package/third-party/common/phonemis/src/third-party/xsimd/types/xsimd_wasm_register.hpp +59 -0
  227. package/third-party/common/phonemis/src/third-party/xsimd/utils/bits.hpp +122 -0
  228. package/third-party/common/phonemis/src/third-party/xsimd/utils/xsimd_type_traits.hpp +145 -0
  229. package/third-party/common/phonemis/src/third-party/xsimd/xsimd.hpp +43 -0
  230. package/third-party/common/phonemis/src/phonemis/base/processor/constants.h +0 -11
  231. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/config.h +0 -16
  232. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/layer.cpp +0 -271
  233. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/layer.h +0 -45
  234. package/third-party/common/phonemis/src/phonemis/base/processor/num2word/types.h +0 -29
  235. package/third-party/common/phonemis/src/phonemis/base/processor/sanitizer_layer.cpp +0 -22
  236. package/third-party/common/phonemis/src/phonemis/base/processor/trim_layer.cpp +0 -40
  237. 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 <unordered_set>
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
- // Set of all possible tags extracted from the model
38
- std::unordered_set<Tag> tags_;
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
- // Probability tables
41
- std::unordered_map<Tag, double> start_probs_;
42
- // Tag -> Word -> Probability (UTF-8 word keys to save memory)
43
- std::unordered_map<Tag, std::unordered_map<std::string, double>> emission_probs_;
44
- // PrevTag -> NextTag -> Probability
45
- std::unordered_map<Tag, std::unordered_map<Tag, double>> transition_probs_;
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
- std::vector<Token> tokens;
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
- size_t currw_offset = 0, currw_len = 0;
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
- 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
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
- // 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
- }
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
- // Edge case - an empty chunk/word ("")
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
- // Note that the lookup is not case sensitive.
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
- return rules_ && rules_->contains(c) ?
179
- rules_->at(c) : split::Rule::TOTAL_DIVIDE;
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
- inline const std::unordered_map<int32_t, std::u32string> kCardinals = {
17
- {0, U"null"}, {1, U"eins"}, {2, U"zwei"}, {3, U"drei"}, {4, U"vier"},
18
- {5, U"fünf"}, {6, U"sechs"}, {7, U"sieben"}, {8, U"acht"}, {9, U"neun"},
19
- {10, U"zehn"}, {11, U"elf"}, {12, U"zwölf"}, {13, U"dreizehn"}, {14, U"vierzehn"},
20
- {15, U"fünfzehn"}, {16, U"sechzehn"}, {17, U"siebzehn"}, {18, U"achtzehn"}, {19, U"neunzehn"},
21
- {20, U"zwanzig"}, {30, U"dreißig"}, {40, U"vierzig"}, {50, U"fünfzig"}, {60, U"sechzig"},
22
- {70, U"siebzig"}, {80, U"achtzig"}, {90, U"neunzig"}
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 const std::map<std::int64_t, std::u32string> kLargeCardinals = {
26
- {100LL, U"hundert"},
27
- {1000LL, U"tausend"},
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 const std::unordered_map<char32_t, std::u32string> kCurrencies = {
33
- {U'$', U"Dollar"}, {U'€', U"Euro"}, {U'£', U"Pfund"}
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"", U"Januar", U"Februar", U"März", U"April", U"Mai", U"Juni",
38
- U"Juli", U"August", U"September", U"Oktober", U"November", U"Dezember"
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
- inline const std::unordered_set<std::u32string> kOrdinalSuffixes = {
42
- U".", U"te", U"ste", U"ten", U"sten", U"ter", U"ster", U"tes", U"stes", U"tem", U"stem"
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;