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
@@ -1,25 +1,57 @@
1
1
  #pragma once
2
2
 
3
- #include <phonemis/base/processor/num2word/layer.h>
3
+ #include <phonemis/base/processor/layers/num2word/layer.h>
4
+
4
5
  #include <string>
5
- #include <variant>
6
6
 
7
7
  namespace phonemis::pl {
8
8
 
9
- class Num2Word : public processor::num2word::Num2WordLayer {
9
+ using processor::num2word::Case;
10
+ using processor::num2word::Form;
11
+ using processor::num2word::Gender;
12
+
13
+ // How a Polish number is read: its form, and the case and gender its words agree with.
14
+ struct NumberReading {
15
+ Form form = Form::CARDINAL; // An ordinal for years, days of a month and headings
16
+ Case grammatical_case = Case::NOMINATIVE;
17
+ Gender gender = Gender::MASCULINE;
18
+ bool plural = false; // lata 70.: an ordinal in the plural
19
+ Case amount_case = Case::NOMINATIVE; // The case of an amount (5 kg): of its number and its noun
20
+ bool numbered = false; // numerem 3x38: the "x" of a document number stands for a slash
21
+ };
22
+
23
+ /**
24
+ * Polish numbers inflect for case and gender, so most readings first find the case a number takes:
25
+ * from the preposition before it (od pięciu), the noun after it (z trzema kolegami), a governing noun or verb
26
+ * (od kwoty trzystu tysięcy), or the year and date patterns which make it an ordinal (w 1985 roku).
27
+ */
28
+ class Num2Word : public processor::num2word::Num2WordLayer<NumberReading> {
10
29
  public:
11
- using Num2WordLayer::Num2WordLayer;
12
-
13
- char32_t decimal_separator() const override { return U','; }
14
- std::u32string to_cardinal_int(int32_t number) const override;
15
- std::u32string to_cardinal_float(float number, std::u32string_view repr) const override;
16
- std::u32string to_ordinal_int(int32_t number, std::u32string_view suffix = U"") const override;
17
- std::u32string to_currency(char32_t currency, std::variant<int32_t, float> number) const override;
18
- std::u32string to_fraction(int32_t numerator, int32_t denominator) const override;
19
- std::u32string to_day(uint32_t day) const override;
20
- std::u32string to_month(uint32_t month) const override;
21
- std::u32string to_year(uint32_t year) const override;
22
- bool is_ordinal_suffix(std::u32string_view suffix) const override;
30
+ Num2Word();
31
+
32
+ protected:
33
+ using Context = processor::Context;
34
+ using Match = processor::num2word::Match;
35
+ using Number = processor::num2word::Number;
36
+
37
+ // Resolution
38
+ bool accept(const Match& match, const Context& context) const override;
39
+ NumberReading resolve(const Match& match, const Context& context) const override;
40
+
41
+ // Readings
42
+ std::u32string read_number(const Number& number, const NumberReading& reading) const override;
43
+ std::u32string read_code_digits(std::u32string_view digits) const override;
44
+ std::u32string read_date(const Match& match, const NumberReading& reading) const override;
45
+ std::u32string read_phone(const Match& match, const NumberReading& reading) const override;
46
+ std::u32string read_time(const Match& match, const NumberReading& reading) const override;
47
+ std::u32string read_ordinal(const Match& match, const NumberReading& reading) const override;
48
+ std::u32string read_compound(const Match& match, const NumberReading& reading) const override;
49
+ std::u32string read_plain(const Match& match, const NumberReading& reading) const override;
50
+ std::u32string read_money(const Number& number, const Match& match, const NumberReading& reading) const override;
51
+ std::u32string read_scale(const Number& number, const Match& match, const NumberReading& reading) const override;
52
+ std::u32string read_percent(const Number& number, const Match& match, const NumberReading& reading) const override;
53
+ std::u32string read_unit(const Number& number, const Match& match, const NumberReading& reading) const override;
54
+ std::u32string read_joiner(const Match& match, const NumberReading& reading) const override;
23
55
  };
24
56
 
25
57
  } // namespace phonemis::pl
@@ -7,9 +7,9 @@
7
7
  #include <phonemis/base/ipipeline.h>
8
8
  #include <phonemis/base/phonemizer/hybrid_phonemizer.h>
9
9
  #include <phonemis/base/phonemizer/lexicon_phonemizer.h>
10
+ #include <phonemis/base/processor/layers/sanitizer/layer.h>
11
+ #include <phonemis/base/processor/preprocessor.h>
10
12
  #include <phonemis/base/processor/processor.h>
11
- #include <phonemis/base/processor/sanitizer_layer.h>
12
- #include <phonemis/base/processor/trim_layer.h>
13
13
  #include <phonemis/base/tokenizer/tokenizer.h>
14
14
 
15
15
  #include <memory>
@@ -24,11 +24,11 @@ public:
24
24
  phonemizer_(config.phonemizer) {
25
25
 
26
26
  // 1. Setup Preprocessing layers
27
- preprocessor_.add_layer(std::make_unique<processor::TrimLayer>());
28
- preprocessor_.add_layer(std::make_unique<Num2Word>());
27
+ preprocessor_ = processor::make_preprocessor<Num2Word>(
28
+ config.preprocessor, {.terms = &constants::term2word::kTerms, .symbols = &constants::sym2word::kSymbols});
29
29
 
30
30
  // 2. Setup Postprocessing layers
31
- postprocessor_.add_layer(std::make_unique<processor::SanitizerLayer>(
31
+ postprocessor_.add_layer(std::make_unique<processor::sanitizer::SanitizerLayer>(
32
32
  [](char32_t) { return true; },
33
33
  [](char32_t c) {
34
34
  if (constants::sanitizer::kCharReplacements.contains(c)) {
@@ -60,7 +60,7 @@ public:
60
60
  private:
61
61
  // Required submodules
62
62
  processor::Preprocessor preprocessor_;
63
- processor::Preprocessor postprocessor_;
63
+ processor::Postprocessor postprocessor_;
64
64
  tokenizer::Tokenizer tokenizer_;
65
65
  phonemizer::HybridPhonemizer<phonemizer::LexiconPhonemizer, phonemizer::nn::NeuralPhonemizer> phonemizer_;
66
66
  };
@@ -1,11 +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>
10
+ #include <cstdint>
11
+ #include <map>
12
+ #include <string>
13
+ #include <string_view>
5
14
  #include <unordered_map>
15
+ #include <unordered_set>
16
+ #include <utility>
17
+ #include <vector>
6
18
 
7
19
  namespace phonemis::pt::constants {
8
20
 
21
+ // --- Number to Word Normalization ---
22
+ namespace num2word {
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
+ // Brazilian forms: dezesseis, bilhão
33
+ inline constexpr std::array<std::u32string_view, 20> kOnes = {
34
+ U"zero", U"um", U"dois", U"três", U"quatro", U"cinco", U"seis", U"sete", U"oito", U"nove",
35
+ U"dez", U"onze", U"doze", U"treze", U"catorze", U"quinze", U"dezesseis", U"dezessete", U"dezoito", U"dezenove"
36
+ };
37
+
38
+ inline constexpr std::array<std::u32string_view, 10> kTens = {
39
+ U"", U"", U"vinte", U"trinta", U"quarenta", U"cinquenta", U"sessenta", U"setenta", U"oitenta", U"noventa"
40
+ };
41
+
42
+ inline constexpr std::array<std::u32string_view, 10> kHundreds = {
43
+ U"", U"cento", U"duzentos", U"trezentos", U"quatrocentos",
44
+ U"quinhentos", U"seiscentos", U"setecentos", U"oitocentos", U"novecentos"
45
+ };
46
+
47
+ // Ordinal stems, completed by -o or -a: vigésima primeira
48
+ inline constexpr std::array<std::u32string_view, 10> kOrdinalOnes = {
49
+ U"", U"primeir", U"segund", U"terceir", U"quart", U"quint", U"sext", U"sétim", U"oitav", U"non"
50
+ };
51
+ inline constexpr std::array<std::u32string_view, 10> kOrdinalTens = {
52
+ U"", U"décim", U"vigésim", U"trigésim", U"quadragésim",
53
+ U"quinquagésim", U"sexagésim", U"septuagésim", U"octogésim", U"nonagésim"
54
+ };
55
+ inline constexpr std::array<std::u32string_view, 10> kOrdinalHundreds = {
56
+ U"", U"centésim", U"ducentésim", U"trecentésim", U"quadringentésim",
57
+ U"quingentésim", U"sexcentésim", U"septingentésim", U"octingentésim", U"noningentésim"
58
+ };
59
+
60
+ inline const std::vector<std::u32string> kMonths = {
61
+ U"janeiro", U"fevereiro", U"março", U"abril", U"maio", U"junho",
62
+ U"julho", U"agosto", U"setembro", U"outubro", U"novembro", U"dezembro"
63
+ };
64
+
65
+ inline const std::unordered_map<std::u32string, Forms> kCurrencies = {
66
+ {U"R$", {U"real", U"reais"}}, {U"US$", {U"dólar", U"dólares"}}, {U"$", {U"dólar", U"dólares"}},
67
+ {U"€", {U"euro", U"euros"}}, {U"£", {U"libra", U"libras"}}
68
+ };
69
+
70
+ // Full words are kept as written; abbreviations take the singular below 2
71
+ inline const std::unordered_map<std::u32string, Forms> kScales = {
72
+ {U"mil", {U"mil", U"mil"}}, {U"k", {U"mil", U"mil"}}, {U"K", {U"mil", U"mil"}},
73
+ {U"milhão", {U"milhão", U"milhão"}}, {U"milhões", {U"milhões", U"milhões"}},
74
+ {U"bilhão", {U"bilhão", U"bilhão"}}, {U"bilhões", {U"bilhões", U"bilhões"}},
75
+ {U"trilhão", {U"trilhão", U"trilhão"}}, {U"trilhões", {U"trilhões", U"trilhões"}},
76
+ {U"mi", {U"milhão", U"milhões"}}, {U"bi", {U"bilhão", U"bilhões"}},
77
+ {U"tri", {U"trilhão", U"trilhões"}}
78
+ };
79
+
80
+ inline const std::unordered_map<std::u32string, Forms> kUnits = {
81
+ {U"km", {U"quilômetro", U"quilômetros"}}, {U"m", {U"metro", U"metros"}},
82
+ {U"cm", {U"centímetro", U"centímetros"}}, {U"mm", {U"milímetro", U"milímetros"}},
83
+ {U"nm", {U"nanômetro", U"nanômetros"}}, {U"m²", {U"metro quadrado", U"metros quadrados"}},
84
+ {U"km²", {U"quilômetro quadrado", U"quilômetros quadrados"}}, {U"m³", {U"metro cúbico", U"metros cúbicos"}},
85
+ {U"ha", {U"hectare", U"hectares"}}, {U"kg", {U"quilo", U"quilos"}},
86
+ {U"g", {U"grama", U"gramas"}}, {U"mg", {U"miligrama", U"miligramas"}},
87
+ {U"t", {U"tonelada", U"toneladas"}}, {U"l", {U"litro", U"litros"}},
88
+ {U"L", {U"litro", U"litros"}}, {U"ml", {U"mililitro", U"mililitros"}},
89
+ {U"mL", {U"mililitro", U"mililitros"}}, {U"TB", {U"terabyte", U"terabytes"}},
90
+ {U"GB", {U"gigabyte", U"gigabytes"}}, {U"MB", {U"megabyte", U"megabytes"}},
91
+ {U"KB", {U"kilobyte", U"kilobytes"}}, {U"Hz", {U"hertz", U"hertz"}},
92
+ {U"kHz", {U"quilohertz", U"quilohertz"}}, {U"MHz", {U"megahertz", U"megahertz"}},
93
+ {U"GHz", {U"gigahertz", U"gigahertz"}}, {U"W", {U"watt", U"watts"}},
94
+ {U"kW", {U"quilowatt", U"quilowatts"}}, {U"kWh", {U"quilowatt-hora", U"quilowatts-hora"}},
95
+ {U"V", {U"volt", U"volts"}}, {U"km/h", {U"quilômetro por hora", U"quilômetros por hora"}},
96
+ {U"mph", {U"milha por hora", U"milhas por hora"}}, {U"°C", {U"grau Celsius", U"graus Celsius"}},
97
+ {U"°", {U"grau", U"graus"}}
98
+ };
99
+
100
+ inline const std::map<std::pair<uint64_t, uint64_t>, std::u32string> kFractions = {
101
+ {{1, 2}, U"meio"}, {{1, 3}, U"um terço"}, {{2, 3}, U"dois terços"}, {{1, 4}, U"um quarto"},
102
+ {{3, 4}, U"três quartos"}
103
+ };
104
+
105
+ // Scale words which take "de" before a currency: um milhão de reais, but dez mil reais
106
+ inline const std::vector<std::u32string> kScaleWords = {
107
+ U"milhão", U"milhões", U"bilhão", U"bilhões", U"trilhão", U"trilhões"
108
+ };
109
+
110
+ // Words before an hour, which make it feminine: às duas, das dez
111
+ inline const std::unordered_set<std::u32string> kHourWords = {U"às", U"à", U"das", U"pelas"};
112
+
113
+ // Parts of the day after "da": duas da tarde
114
+ inline const std::unordered_set<std::u32string> kDayParts = {U"manhã", U"tarde", U"noite", U"madrugada"};
115
+
116
+ // Legal headings, after which an ordinal from 10 on reads as a cardinal: artigo 80º, artigo oitenta
117
+ inline const std::unordered_set<std::u32string> kHeadings = {U"artigo", U"art", U"parágrafo", U"capítulo", U"inciso"};
118
+
119
+ // Nouns in -a are feminine unless listed below; other feminine nouns are listed or end like one
120
+ inline const std::unordered_set<std::u32string> kMasculineInA = {
121
+ U"dia", U"mapa", U"problema", U"sistema", U"programa", U"tema", U"idioma", U"clima", U"planeta", U"poema",
122
+ U"cometa", U"drama", U"esquema", U"sofá", U"diagrama", U"teorema", U"telefonema", U"cinema", U"prisma",
123
+ U"pijama", U"aroma", U"dilema", U"fantasma", U"panorama", U"enigma", U"dogma", U"carisma", U"atleta", U"guia",
124
+ U"pila"
125
+ };
126
+ inline const std::unordered_set<std::u32string> kFeminineNouns = {
127
+ U"vez", U"mão", U"foto", U"moto", U"mulher", U"flor", U"noite", U"tarde", U"parte", U"gente", U"lei", U"luz",
128
+ U"voz", U"paz", U"rede", U"sede", U"fase", U"base", U"frase", U"classe", U"chave", U"fonte", U"mente", U"morte",
129
+ U"sorte", U"ponte", U"árvore", U"nuvem", U"ordem", U"série", U"espécie", U"superfície", U"cor", U"dor", U"mãe",
130
+ U"pele", U"neve", U"febre", U"carne", U"torre", U"hora", U"semana", U"polegada", U"lição"
131
+ };
132
+ inline const std::vector<std::u32string> kFeminineEndings = {
133
+ U"a", U"ção", U"são", U"dade", U"tude", U"gem", U"ise", U"ite", U"ez"
134
+ };
135
+
136
+ // Words after a number which are not the noun it counts
137
+ inline const std::unordered_set<std::u32string> kStopWords = {
138
+ U"de", U"do", U"da", U"dos", U"das", U"em", U"no", U"na", U"nos", U"nas", U"com", U"por", U"para", U"sem", U"que",
139
+ U"e", U"ou", U"a", U"o", U"os", U"as", U"um", U"uma", U"uns", U"umas", U"é", U"são", U"era", U"foi", U"mais",
140
+ U"menos", U"até", U"desde", U"entre", U"sobre", U"contra", U"após", U"cada", U"todo", U"toda", U"todos", U"todas",
141
+ U"este", U"esta", U"estes", U"estas", U"esse", U"essa", U"esses", U"essas", U"isso", U"isto", U"já", U"agora",
142
+ U"quando", U"onde", U"muito", U"também", U"se", U"lhe", U"me", U"te", U"ao", U"à", U"aos", U"às", U"pelo",
143
+ U"pela", U"pelos", U"pelas", U"não", U"sim", U"meu", U"minha", U"seu", U"sua"
144
+ };
145
+
146
+ // --- Notation: how numbers are written ---
147
+ inline const Notation kNotation = {
148
+ .group_separators = U".", .decimal_separators = U",.", .time_separators = U":h", .time_suffixes = {U"h"},
149
+ .currencies = keys_of(kCurrencies), .scales = keys_of(kScales), .units = keys_of(kUnits), .fractions = true
150
+ };
151
+
152
+ // Words between numbers: 3.8.10, 10.0.0.51, 10-15, 1920x1080, 2:1, -5, 2 + 2
153
+ inline const Joiners kJoiners = {
154
+ .point = U"ponto", .dot = U"ponto", .range = U" a ", .by = U"por", .score = U" a ", .minus = U"menos", .plus = U"mais"
155
+ };
156
+
157
+ // 24/03/2022, 07-11-2018
158
+ inline const DateFormat kDateFormat = {.separators = U"/-", .boundaries = U".,/-"};
159
+
160
+ // (11) 98765-4321, 0800-123456, 3456-7890, 213 456 789 (after a word of kPhoneWords): the longest first
161
+ inline const std::vector<PhoneFormat> kPhoneFormats = {
162
+ {.groups = {{2, 2}, {4, 5}, {4, 4}}, .parenthesized = true, .closing = U"-"},
163
+ {.groups = {{4, 5}, {4, 6}}, .separators = U"-", .boundaries = U".,-", .closing = U"-"},
164
+ {.groups = {{3, 3}, {3, 3}, {3, 3}}, .separators = U" ", .boundaries = U".,-", .closing = U"-"}
165
+ };
166
+
167
+ // Words before a phone number written with spaces, which else reads as numbers: ligue para 213 456 789
168
+ inline const std::unordered_set<std::u32string> kPhoneWords = {
169
+ U"para", U"telefone", U"tel", U"ligue", U"contato", U"contacto", U"número", U"whatsapp", U"fax"
170
+ };
171
+
172
+ // 1º, 2 ª: a sign, possibly after a space
173
+ inline const Keys kOrdinalSigns = {U"º", U"ª"};
174
+ inline const SuffixFormat kOrdinalSignFormat = {.space = true, .word_end = false};
175
+ } // namespace num2word
176
+
177
+ // --- Symbols to Word Normalization ---
178
+ namespace sym2word {
179
+ using ::phonemis::processor::Readings;
180
+
181
+ inline const Readings kSymbols = {
182
+ {U"&", {U"e"}}, {U"+", {U"mais"}}, {U"=", {U"igual a"}}, {U"@", {U"arroba"}}, {U"%", {U"por cento"}},
183
+ {U"°", {U"graus"}}, {U"#", {U"hashtag"}}, {U"²", {U"ao quadrado"}}, {U"³", {U"ao cubo"}}, {U"π", {U"pi"}},
184
+ {U"×", {U"vezes"}}, {U"€", {U"euros"}}, {U"$", {U"dólares"}}, {U"£", {U"libras"}}, {U"§", {U"parágrafo"}}
185
+ };
186
+ } // namespace sym2word
187
+
188
+ // --- Terms to Word Normalization ---
189
+ namespace term2word {
190
+ using ::phonemis::processor::before_number;
191
+ using ::phonemis::processor::term2word::Terms;
192
+
193
+ inline const Terms kTerms = {
194
+ .abbreviations = {
195
+ // Before a number only: nº 5
196
+ {U"nº", {{U"número", before_number}}},
197
+ {U"Nº", {{U"número", before_number}}},
198
+ {U"n.º", {{U"número", before_number}}},
199
+ {U"N.º", {{U"número", before_number}}},
200
+ {U"núm.", {{U"número", before_number}}},
201
+ {U"art.", {{U"artigo", before_number}}},
202
+ {U"Art.", {{U"artigo", before_number}}},
203
+ {U"pág.", {{U"página", before_number}}},
204
+ {U"§", {{U"parágrafo", before_number}}},
205
+ },
206
+ .web = {.dot = U"ponto", .at = U"arroba", .slash = U"barra"}
207
+ };
208
+ } // namespace term2word
209
+
9
210
  // --- Tokenization Rules ---
10
211
  namespace tokenizer {
11
212
  using ::phonemis::tokenizer::split::Rule;