words2num2 0.3.0.dev2__tar.gz → 0.3.2__tar.gz

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 (183) hide show
  1. {words2num2-0.3.0.dev2 → words2num2-0.3.2}/PKG-INFO +103 -50
  2. words2num2-0.3.0.dev2/words2num2.egg-info/PKG-INFO → words2num2-0.3.2/README.rst +89 -66
  3. words2num2-0.3.2/pyproject.toml +94 -0
  4. words2num2-0.3.2/rust/Cargo.lock +287 -0
  5. words2num2-0.3.2/rust/Cargo.toml +16 -0
  6. words2num2-0.3.2/rust/words2num2-core/Cargo.toml +18 -0
  7. words2num2-0.3.2/rust/words2num2-core/src/lib.rs +620 -0
  8. words2num2-0.3.2/rust/words2num2-core/src/w2n_formats.rs +1056 -0
  9. words2num2-0.3.2/rust/words2num2-core/src/w2n_lang_en.rs +1011 -0
  10. words2num2-0.3.2/rust/words2num2-core/src/w2n_sentence.rs +2459 -0
  11. words2num2-0.3.2/rust/words2num2-py/Cargo.toml +14 -0
  12. words2num2-0.3.2/rust/words2num2-py/src/lib.rs +312 -0
  13. words2num2-0.3.2/words2num2/__init__.py +140 -0
  14. words2num2-0.3.2/words2num2/_version.py +5 -0
  15. words2num2-0.3.2/words2num2/base.py +19 -0
  16. words2num2-0.3.2/words2num2/converters/auto.py +43 -0
  17. words2num2-0.3.0.dev2/.flake8 +0 -11
  18. words2num2-0.3.0.dev2/.github/workflows/aur-publish.yml +0 -104
  19. words2num2-0.3.0.dev2/.github/workflows/ci.yml +0 -68
  20. words2num2-0.3.0.dev2/.github/workflows/codeql-analysis.yml +0 -38
  21. words2num2-0.3.0.dev2/.github/workflows/e2e-tests.yml +0 -73
  22. words2num2-0.3.0.dev2/.github/workflows/lint.yml +0 -47
  23. words2num2-0.3.0.dev2/.github/workflows/manual-publish.yml +0 -66
  24. words2num2-0.3.0.dev2/.github/workflows/manual-release.yml +0 -81
  25. words2num2-0.3.0.dev2/.github/workflows/pr-size.yml +0 -67
  26. words2num2-0.3.0.dev2/.github/workflows/publish-pypi.yml +0 -76
  27. words2num2-0.3.0.dev2/.github/workflows/python-publish.yml +0 -61
  28. words2num2-0.3.0.dev2/.github/workflows/release.yml +0 -166
  29. words2num2-0.3.0.dev2/.github/workflows/scheduled-test.yml +0 -44
  30. words2num2-0.3.0.dev2/.gitignore +0 -18
  31. words2num2-0.3.0.dev2/CHANGELOG.md +0 -152
  32. words2num2-0.3.0.dev2/CONTRIBUTING.md +0 -123
  33. words2num2-0.3.0.dev2/LOCAL_TESTING.md +0 -173
  34. words2num2-0.3.0.dev2/MANIFEST.in +0 -5
  35. words2num2-0.3.0.dev2/Makefile +0 -50
  36. words2num2-0.3.0.dev2/README.rst +0 -360
  37. words2num2-0.3.0.dev2/REFERENCE.md +0 -450
  38. words2num2-0.3.0.dev2/bin/words2num2 +0 -28
  39. words2num2-0.3.0.dev2/packaging/aur/python-words2num2/.SRCINFO +0 -20
  40. words2num2-0.3.0.dev2/packaging/aur/python-words2num2/PKGBUILD +0 -33
  41. words2num2-0.3.0.dev2/packaging/aur/python-words2num2/README.md +0 -88
  42. words2num2-0.3.0.dev2/pyproject.toml +0 -88
  43. words2num2-0.3.0.dev2/setup.cfg +0 -4
  44. words2num2-0.3.0.dev2/setup.py +0 -63
  45. words2num2-0.3.0.dev2/tests/__init__.py +0 -0
  46. words2num2-0.3.0.dev2/tests/test_auto_parse.py +0 -252
  47. words2num2-0.3.0.dev2/tests/test_dispatch.py +0 -28
  48. words2num2-0.3.0.dev2/tests/test_lang_EN.py +0 -113
  49. words2num2-0.3.0.dev2/tests/test_multilang.py +0 -49
  50. words2num2-0.3.0.dev2/words2num2/__init__.py +0 -360
  51. words2num2-0.3.0.dev2/words2num2/_version.py +0 -3
  52. words2num2-0.3.0.dev2/words2num2/base.py +0 -155
  53. words2num2-0.3.0.dev2/words2num2/compat.py +0 -9
  54. words2num2-0.3.0.dev2/words2num2/converters/auto.py +0 -586
  55. words2num2-0.3.0.dev2/words2num2/converters/sentence.py +0 -116
  56. words2num2-0.3.0.dev2/words2num2/formats.py +0 -212
  57. words2num2-0.3.0.dev2/words2num2/lang_AF.py +0 -15
  58. words2num2-0.3.0.dev2/words2num2/lang_AM.py +0 -15
  59. words2num2-0.3.0.dev2/words2num2/lang_AR.py +0 -15
  60. words2num2-0.3.0.dev2/words2num2/lang_AS.py +0 -15
  61. words2num2-0.3.0.dev2/words2num2/lang_AZ.py +0 -15
  62. words2num2-0.3.0.dev2/words2num2/lang_BA.py +0 -15
  63. words2num2-0.3.0.dev2/words2num2/lang_BE.py +0 -15
  64. words2num2-0.3.0.dev2/words2num2/lang_BG.py +0 -15
  65. words2num2-0.3.0.dev2/words2num2/lang_BN.py +0 -15
  66. words2num2-0.3.0.dev2/words2num2/lang_BO.py +0 -15
  67. words2num2-0.3.0.dev2/words2num2/lang_BR.py +0 -15
  68. words2num2-0.3.0.dev2/words2num2/lang_BS.py +0 -15
  69. words2num2-0.3.0.dev2/words2num2/lang_CA.py +0 -15
  70. words2num2-0.3.0.dev2/words2num2/lang_CE.py +0 -15
  71. words2num2-0.3.0.dev2/words2num2/lang_CS.py +0 -15
  72. words2num2-0.3.0.dev2/words2num2/lang_CY.py +0 -15
  73. words2num2-0.3.0.dev2/words2num2/lang_DA.py +0 -15
  74. words2num2-0.3.0.dev2/words2num2/lang_DE.py +0 -15
  75. words2num2-0.3.0.dev2/words2num2/lang_EL.py +0 -15
  76. words2num2-0.3.0.dev2/words2num2/lang_EN.py +0 -242
  77. words2num2-0.3.0.dev2/words2num2/lang_EN_IN.py +0 -15
  78. words2num2-0.3.0.dev2/words2num2/lang_EN_NG.py +0 -15
  79. words2num2-0.3.0.dev2/words2num2/lang_EO.py +0 -15
  80. words2num2-0.3.0.dev2/words2num2/lang_ES.py +0 -15
  81. words2num2-0.3.0.dev2/words2num2/lang_ES_CO.py +0 -15
  82. words2num2-0.3.0.dev2/words2num2/lang_ES_CR.py +0 -15
  83. words2num2-0.3.0.dev2/words2num2/lang_ES_GT.py +0 -15
  84. words2num2-0.3.0.dev2/words2num2/lang_ES_NI.py +0 -15
  85. words2num2-0.3.0.dev2/words2num2/lang_ES_VE.py +0 -15
  86. words2num2-0.3.0.dev2/words2num2/lang_ET.py +0 -15
  87. words2num2-0.3.0.dev2/words2num2/lang_EU.py +0 -15
  88. words2num2-0.3.0.dev2/words2num2/lang_FA.py +0 -15
  89. words2num2-0.3.0.dev2/words2num2/lang_FI.py +0 -15
  90. words2num2-0.3.0.dev2/words2num2/lang_FO.py +0 -15
  91. words2num2-0.3.0.dev2/words2num2/lang_FR.py +0 -15
  92. words2num2-0.3.0.dev2/words2num2/lang_FR_BE.py +0 -15
  93. words2num2-0.3.0.dev2/words2num2/lang_FR_CH.py +0 -15
  94. words2num2-0.3.0.dev2/words2num2/lang_FR_DZ.py +0 -15
  95. words2num2-0.3.0.dev2/words2num2/lang_GL.py +0 -15
  96. words2num2-0.3.0.dev2/words2num2/lang_GU.py +0 -15
  97. words2num2-0.3.0.dev2/words2num2/lang_HA.py +0 -15
  98. words2num2-0.3.0.dev2/words2num2/lang_HAW.py +0 -15
  99. words2num2-0.3.0.dev2/words2num2/lang_HE.py +0 -15
  100. words2num2-0.3.0.dev2/words2num2/lang_HI.py +0 -15
  101. words2num2-0.3.0.dev2/words2num2/lang_HR.py +0 -15
  102. words2num2-0.3.0.dev2/words2num2/lang_HT.py +0 -15
  103. words2num2-0.3.0.dev2/words2num2/lang_HU.py +0 -15
  104. words2num2-0.3.0.dev2/words2num2/lang_HY.py +0 -15
  105. words2num2-0.3.0.dev2/words2num2/lang_ID.py +0 -15
  106. words2num2-0.3.0.dev2/words2num2/lang_IS.py +0 -15
  107. words2num2-0.3.0.dev2/words2num2/lang_IT.py +0 -15
  108. words2num2-0.3.0.dev2/words2num2/lang_JA.py +0 -15
  109. words2num2-0.3.0.dev2/words2num2/lang_JW.py +0 -15
  110. words2num2-0.3.0.dev2/words2num2/lang_KA.py +0 -15
  111. words2num2-0.3.0.dev2/words2num2/lang_KK.py +0 -15
  112. words2num2-0.3.0.dev2/words2num2/lang_KM.py +0 -15
  113. words2num2-0.3.0.dev2/words2num2/lang_KN.py +0 -15
  114. words2num2-0.3.0.dev2/words2num2/lang_KO.py +0 -15
  115. words2num2-0.3.0.dev2/words2num2/lang_KZ.py +0 -15
  116. words2num2-0.3.0.dev2/words2num2/lang_LA.py +0 -15
  117. words2num2-0.3.0.dev2/words2num2/lang_LB.py +0 -15
  118. words2num2-0.3.0.dev2/words2num2/lang_LN.py +0 -15
  119. words2num2-0.3.0.dev2/words2num2/lang_LO.py +0 -15
  120. words2num2-0.3.0.dev2/words2num2/lang_LT.py +0 -15
  121. words2num2-0.3.0.dev2/words2num2/lang_LV.py +0 -15
  122. words2num2-0.3.0.dev2/words2num2/lang_MG.py +0 -15
  123. words2num2-0.3.0.dev2/words2num2/lang_MI.py +0 -15
  124. words2num2-0.3.0.dev2/words2num2/lang_MK.py +0 -15
  125. words2num2-0.3.0.dev2/words2num2/lang_ML.py +0 -15
  126. words2num2-0.3.0.dev2/words2num2/lang_MN.py +0 -15
  127. words2num2-0.3.0.dev2/words2num2/lang_MR.py +0 -15
  128. words2num2-0.3.0.dev2/words2num2/lang_MS.py +0 -15
  129. words2num2-0.3.0.dev2/words2num2/lang_MT.py +0 -15
  130. words2num2-0.3.0.dev2/words2num2/lang_MY.py +0 -15
  131. words2num2-0.3.0.dev2/words2num2/lang_NE.py +0 -15
  132. words2num2-0.3.0.dev2/words2num2/lang_NL.py +0 -15
  133. words2num2-0.3.0.dev2/words2num2/lang_NN.py +0 -15
  134. words2num2-0.3.0.dev2/words2num2/lang_NO.py +0 -15
  135. words2num2-0.3.0.dev2/words2num2/lang_OC.py +0 -15
  136. words2num2-0.3.0.dev2/words2num2/lang_PA.py +0 -15
  137. words2num2-0.3.0.dev2/words2num2/lang_PL.py +0 -15
  138. words2num2-0.3.0.dev2/words2num2/lang_PS.py +0 -15
  139. words2num2-0.3.0.dev2/words2num2/lang_PT.py +0 -15
  140. words2num2-0.3.0.dev2/words2num2/lang_PT_BR.py +0 -15
  141. words2num2-0.3.0.dev2/words2num2/lang_RO.py +0 -15
  142. words2num2-0.3.0.dev2/words2num2/lang_RU.py +0 -15
  143. words2num2-0.3.0.dev2/words2num2/lang_SA.py +0 -15
  144. words2num2-0.3.0.dev2/words2num2/lang_SD.py +0 -15
  145. words2num2-0.3.0.dev2/words2num2/lang_SI.py +0 -15
  146. words2num2-0.3.0.dev2/words2num2/lang_SK.py +0 -15
  147. words2num2-0.3.0.dev2/words2num2/lang_SL.py +0 -15
  148. words2num2-0.3.0.dev2/words2num2/lang_SN.py +0 -15
  149. words2num2-0.3.0.dev2/words2num2/lang_SO.py +0 -15
  150. words2num2-0.3.0.dev2/words2num2/lang_SQ.py +0 -15
  151. words2num2-0.3.0.dev2/words2num2/lang_SR.py +0 -15
  152. words2num2-0.3.0.dev2/words2num2/lang_SU.py +0 -15
  153. words2num2-0.3.0.dev2/words2num2/lang_SV.py +0 -15
  154. words2num2-0.3.0.dev2/words2num2/lang_SW.py +0 -15
  155. words2num2-0.3.0.dev2/words2num2/lang_TA.py +0 -15
  156. words2num2-0.3.0.dev2/words2num2/lang_TE.py +0 -15
  157. words2num2-0.3.0.dev2/words2num2/lang_TET.py +0 -15
  158. words2num2-0.3.0.dev2/words2num2/lang_TG.py +0 -15
  159. words2num2-0.3.0.dev2/words2num2/lang_TH.py +0 -15
  160. words2num2-0.3.0.dev2/words2num2/lang_TK.py +0 -15
  161. words2num2-0.3.0.dev2/words2num2/lang_TL.py +0 -15
  162. words2num2-0.3.0.dev2/words2num2/lang_TR.py +0 -15
  163. words2num2-0.3.0.dev2/words2num2/lang_TT.py +0 -15
  164. words2num2-0.3.0.dev2/words2num2/lang_UK.py +0 -15
  165. words2num2-0.3.0.dev2/words2num2/lang_UR.py +0 -15
  166. words2num2-0.3.0.dev2/words2num2/lang_UZ.py +0 -15
  167. words2num2-0.3.0.dev2/words2num2/lang_VI.py +0 -15
  168. words2num2-0.3.0.dev2/words2num2/lang_WO.py +0 -15
  169. words2num2-0.3.0.dev2/words2num2/lang_YI.py +0 -15
  170. words2num2-0.3.0.dev2/words2num2/lang_YO.py +0 -15
  171. words2num2-0.3.0.dev2/words2num2/lang_ZH.py +0 -15
  172. words2num2-0.3.0.dev2/words2num2/lang_ZH_CN.py +0 -15
  173. words2num2-0.3.0.dev2/words2num2/lang_ZH_HK.py +0 -15
  174. words2num2-0.3.0.dev2/words2num2/lang_ZH_TW.py +0 -15
  175. words2num2-0.3.0.dev2/words2num2/utils.py +0 -23
  176. words2num2-0.3.0.dev2/words2num2.egg-info/SOURCES.txt +0 -167
  177. words2num2-0.3.0.dev2/words2num2.egg-info/dependency_links.txt +0 -1
  178. words2num2-0.3.0.dev2/words2num2.egg-info/entry_points.txt +0 -2
  179. words2num2-0.3.0.dev2/words2num2.egg-info/requires.txt +0 -2
  180. words2num2-0.3.0.dev2/words2num2.egg-info/top_level.txt +0 -1
  181. {words2num2-0.3.0.dev2 → words2num2-0.3.2}/COPYING +0 -0
  182. {words2num2-0.3.0.dev2 → words2num2-0.3.2}/words2num2/__main__.py +0 -0
  183. {words2num2-0.3.0.dev2 → words2num2-0.3.2}/words2num2/converters/__init__.py +0 -0
@@ -1,18 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: words2num2
3
- Version: 0.3.0.dev2
4
- Summary: Inverse of num2words2: convert spoken-form numbers back to numeric values across 100+ languages.
5
- Home-page: https://github.com/jqueguiner/words2num2
6
- Author: Jean-Louis Queguiner
7
- Author-email: Jean-Louis Queguiner <jlqueguiner@gladia.io>
8
- Maintainer: Jean-Louis Queguiner
9
- Maintainer-email: Jean-Louis Queguiner <jlqueguiner@gladia.io>
10
- License: LGPL-2.1
11
- Project-URL: Homepage, https://github.com/jqueguiner/words2num2
12
- Project-URL: Documentation, https://github.com/jqueguiner/words2num2/wiki
13
- Project-URL: Repository, https://github.com/jqueguiner/words2num2.git
14
- Project-URL: Bug Tracker, https://github.com/jqueguiner/words2num2/issues
15
- Keywords: number,word,numbers,words,parse,parser,convert,conversion,i18n,localisation,localization,internationalisation,internationalization,asr,speech,llm
3
+ Version: 0.3.2
16
4
  Classifier: Development Status :: 4 - Beta
17
5
  Classifier: Intended Audience :: Developers
18
6
  Classifier: Programming Language :: Python :: 3
@@ -21,21 +9,23 @@ Classifier: Programming Language :: Python :: 3.11
21
9
  Classifier: Programming Language :: Python :: 3.12
22
10
  Classifier: Programming Language :: Python :: 3.13
23
11
  Classifier: Programming Language :: Python :: 3.14
24
- Classifier: Programming Language :: Python :: 3.15
12
+ Classifier: Programming Language :: Rust
25
13
  Classifier: Topic :: Software Development :: Internationalization
26
14
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
15
  Classifier: Topic :: Software Development :: Localization
28
16
  Classifier: Topic :: Text Processing :: Linguistic
29
- Requires-Python: >=3.10
30
- Description-Content-Type: text/x-rst
31
17
  License-File: COPYING
32
- Requires-Dist: docopt>=0.6.2
33
- Requires-Dist: num2words2>=0.1.0.dev0
34
- Dynamic: author
35
- Dynamic: home-page
36
- Dynamic: license
37
- Dynamic: license-file
38
- Dynamic: maintainer
18
+ Summary: Rust-powered inverse of num2words2: parse spoken-form numbers back to numeric values across 100+ languages, optimized for ASR/LLM/speech.
19
+ Keywords: number,word,numbers,words,parse,parser,convert,conversion,i18n,localisation,localization,internationalisation,internationalization,asr,speech,llm,rust
20
+ Author-email: Jean-Louis Queguiner <jean-louis.queguiner@gmail.com>
21
+ Maintainer-email: Jean-Louis Queguiner <jean-louis.queguiner@gmail.com>
22
+ License-Expression: LGPL-2.1-only
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/x-rst; charset=UTF-8
25
+ Project-URL: Bug Tracker, https://github.com/gladiaio/words2num2/issues
26
+ Project-URL: Documentation, https://github.com/gladiaio/words2num2/wiki
27
+ Project-URL: Homepage, https://github.com/gladiaio/words2num2
28
+ Project-URL: Repository, https://github.com/gladiaio/words2num2.git
39
29
 
40
30
  words2num2 — words to numbers
41
31
  =============================
@@ -60,43 +50,43 @@ words2num2 — words to numbers
60
50
  :target: https://aur.archlinux.org/packages/python-words2num2
61
51
  :alt: AUR version
62
52
 
63
- .. image:: https://github.com/jqueguiner/words2num2/workflows/CI/badge.svg
64
- :target: https://github.com/jqueguiner/words2num2/actions/workflows/ci.yml
53
+ .. image:: https://github.com/gladiaio/words2num2/workflows/CI/badge.svg
54
+ :target: https://github.com/gladiaio/words2num2/actions/workflows/ci.yml
65
55
  :alt: CI
66
56
 
67
- .. image:: https://github.com/jqueguiner/words2num2/workflows/Lint/badge.svg
68
- :target: https://github.com/jqueguiner/words2num2/actions/workflows/lint.yml
57
+ .. image:: https://github.com/gladiaio/words2num2/workflows/Lint/badge.svg
58
+ :target: https://github.com/gladiaio/words2num2/actions/workflows/lint.yml
69
59
  :alt: Lint
70
60
 
71
- .. image:: https://github.com/jqueguiner/words2num2/workflows/CodeQL/badge.svg
72
- :target: https://github.com/jqueguiner/words2num2/actions/workflows/codeql-analysis.yml
61
+ .. image:: https://github.com/gladiaio/words2num2/workflows/CodeQL/badge.svg
62
+ :target: https://github.com/gladiaio/words2num2/actions/workflows/codeql-analysis.yml
73
63
  :alt: CodeQL
74
64
 
75
- .. image:: https://github.com/jqueguiner/words2num2/workflows/E2E%20Tests/badge.svg
76
- :target: https://github.com/jqueguiner/words2num2/actions/workflows/e2e-tests.yml
65
+ .. image:: https://github.com/gladiaio/words2num2/workflows/E2E%20Tests/badge.svg
66
+ :target: https://github.com/gladiaio/words2num2/actions/workflows/e2e-tests.yml
77
67
  :alt: E2E Tests
78
68
 
79
- .. image:: https://coveralls.io/repos/github/jqueguiner/words2num2/badge.svg?branch=main
80
- :target: https://coveralls.io/github/jqueguiner/words2num2?branch=main
69
+ .. image:: https://coveralls.io/repos/github/gladiaio/words2num2/badge.svg?branch=main
70
+ :target: https://coveralls.io/github/gladiaio/words2num2?branch=main
81
71
  :alt: Coverage
82
72
 
83
- .. image:: https://img.shields.io/github/v/release/jqueguiner/words2num2.svg
84
- :target: https://github.com/jqueguiner/words2num2/releases
73
+ .. image:: https://img.shields.io/github/v/release/gladiaio/words2num2.svg
74
+ :target: https://github.com/gladiaio/words2num2/releases
85
75
  :alt: Latest release
86
76
 
87
- .. image:: https://img.shields.io/github/last-commit/jqueguiner/words2num2.svg
88
- :target: https://github.com/jqueguiner/words2num2/commits/main
77
+ .. image:: https://img.shields.io/github/last-commit/gladiaio/words2num2.svg
78
+ :target: https://github.com/gladiaio/words2num2/commits/main
89
79
  :alt: Last commit
90
80
 
91
- .. image:: https://img.shields.io/github/issues/jqueguiner/words2num2.svg
92
- :target: https://github.com/jqueguiner/words2num2/issues
81
+ .. image:: https://img.shields.io/github/issues/gladiaio/words2num2.svg
82
+ :target: https://github.com/gladiaio/words2num2/issues
93
83
  :alt: Issues
94
84
 
95
85
  .. image:: https://img.shields.io/badge/license-LGPL--2.1-blue.svg
96
- :target: https://github.com/jqueguiner/words2num2/blob/main/COPYING
86
+ :target: https://github.com/gladiaio/words2num2/blob/main/COPYING
97
87
  :alt: License
98
88
 
99
- The inverse of `num2words2 <https://github.com/jqueguiner/num2words2>`_.
89
+ The inverse of `num2words2 <https://github.com/gladiaio/num2words2>`_.
100
90
 
101
91
  ``words2num2`` parses spoken-form numbers — ``"forty-two"``,
102
92
  ``"trois cent quatre"``, ``"二十三"`` — and returns numeric values.
@@ -105,11 +95,21 @@ entries**) and adds a free-text *auto-parse* mode that handles
105
95
  currencies, units, configurable thousands/decimal separators, and
106
96
  ASR/LLM-style mixed text.
107
97
 
98
+ It is **Rust-powered with a thin Python binder**. The whole parsing engine —
99
+ the English grammar, the generic reverse-lookup backend, the sentence walker,
100
+ number-format parsing and auto-parse — runs in a compiled Rust core
101
+ (PyO3/``abi3``); Python only shapes arguments and results. The core embeds the
102
+ num2words2 conversion engine natively, so ``words2num2`` is **self-contained
103
+ and has no runtime dependencies**, while running several times faster than the
104
+ former pure-Python implementation. Output is unchanged — validated against a
105
+ frozen corpus of ~11,000 round-trip cases.
106
+
108
107
  The project is hosted on GitHub_, and the full documentation is available
109
108
  in the Wiki_. Contributions are welcome.
110
109
 
111
- .. _GitHub: https://github.com/jqueguiner/words2num2
112
- .. _Wiki: https://github.com/jqueguiner/words2num2/wiki
110
+ .. _GitHub: https://github.com/gladiaio/words2num2
111
+ .. _Wiki: https://github.com/gladiaio/words2num2/wiki
112
+ .. _GitHub Releases: https://github.com/gladiaio/words2num2/releases
113
113
 
114
114
  Why this library
115
115
  ----------------
@@ -133,13 +133,64 @@ the forward direction. ``words2num2``:
133
133
  * Pluralizes long-form units in expand mode (``5 dollars`` /
134
134
  ``1 dollar``, ``5 feet`` / ``1 foot``, ``5 yen`` / ``1 yen``).
135
135
 
136
+ Performance
137
+ -----------
138
+
139
+ The parsing engine is compiled Rust (PyO3/``abi3``), so there is no
140
+ Python-level tokenising or table walking on the hot path. Typical native
141
+ throughput (Apple M-series, nanoseconds per call, after warmup):
142
+
143
+ .. list-table::
144
+ :header-rows: 1
145
+ :widths: 60 20
146
+
147
+ * - Operation
148
+ - ns/call
149
+ * - English cardinal (``"eight thousand seven hundred sixty-five"``)
150
+ - ~5,900
151
+ * - English ordinal (``"forty-second"``)
152
+ - ~4,100
153
+ * - French cardinal (``"trois cent quatre"``)
154
+ - ~1,900
155
+ * - Russian cardinal (``"сорок два"``)
156
+ - ~1,700
157
+ * - ``parse_number_string("1.234.567,89", lang="de")``
158
+ - ~240
159
+ * - ``auto_parse("$12,345.00")``
160
+ - ~990
161
+
162
+ For the 100+ generic locales, the first call in a given language builds the
163
+ ``{words → number}`` reverse table once (~35 ms) and caches it in the core;
164
+ every call after that is a native lookup. Output is byte-for-byte identical to
165
+ the former pure-Python implementation, validated against a frozen corpus of
166
+ ~11,000 round-trip cases and the full test suite.
167
+
136
168
  Installation
137
169
  ------------
138
170
 
139
- **pip**::
171
+ **pip** (Python 3.10+)::
140
172
 
141
173
  pip install words2num2
142
174
 
175
+ **cargo** (Rust) — the compiled core is published on crates.io as
176
+ `words2num2-core <https://crates.io/crates/words2num2-core>`_::
177
+
178
+ cargo add words2num2-core
179
+
180
+ That's it — the wheel bundles the Python binder and the compiled Rust
181
+ extension, and ``words2num2`` has **no runtime dependencies** (the num2words2
182
+ conversion engine is compiled in, so you do *not* need the num2words2 package).
183
+
184
+ Prebuilt wheels are published for:
185
+
186
+ * **Linux** — x86_64 and aarch64 (manylinux2014)
187
+ * **macOS** — Apple Silicon (arm64); Intel (x86_64) from a later release
188
+ * **Windows** — x86_64
189
+
190
+ On any other platform (or an older release without a matching wheel), pip
191
+ falls back to the source distribution and builds the extension locally — this
192
+ needs a **stable Rust toolchain** (`rustup <https://rustup.rs>`_); nothing else.
193
+
143
194
  **Arch Linux / Manjaro (AUR):**
144
195
 
145
196
  .. code-block:: bash
@@ -153,14 +204,15 @@ Installation
153
204
  cd python-words2num2
154
205
  makepkg -si
155
206
 
156
- **From source**::
207
+ **From source** (needs a stable Rust toolchain and `maturin
208
+ <https://www.maturin.rs>`_)::
157
209
 
158
- git clone https://github.com/jqueguiner/words2num2
210
+ git clone https://github.com/gladiaio/words2num2
159
211
  cd words2num2
160
- pip install -e .
212
+ pip install -e . # builds the Rust extension via maturin
213
+ # or, to produce a wheel: maturin build --release
161
214
 
162
- ``num2words2`` is a runtime dependency for the generic multi-language
163
- backend and is installed automatically.
215
+ Wheels for every version are also attached to the `GitHub Releases`_ page.
164
216
 
165
217
  Quickstart
166
218
  ----------
@@ -362,7 +414,7 @@ Development
362
414
 
363
415
  .. code-block:: bash
364
416
 
365
- git clone https://github.com/jqueguiner/words2num2
417
+ git clone https://github.com/gladiaio/words2num2
366
418
  cd words2num2
367
419
  make install-dev
368
420
  make test # pytest
@@ -397,3 +449,4 @@ License
397
449
  -------
398
450
 
399
451
  LGPL-2.1, mirroring ``num2words2``. See `COPYING`.
452
+
@@ -1,42 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: words2num2
3
- Version: 0.3.0.dev2
4
- Summary: Inverse of num2words2: convert spoken-form numbers back to numeric values across 100+ languages.
5
- Home-page: https://github.com/jqueguiner/words2num2
6
- Author: Jean-Louis Queguiner
7
- Author-email: Jean-Louis Queguiner <jlqueguiner@gladia.io>
8
- Maintainer: Jean-Louis Queguiner
9
- Maintainer-email: Jean-Louis Queguiner <jlqueguiner@gladia.io>
10
- License: LGPL-2.1
11
- Project-URL: Homepage, https://github.com/jqueguiner/words2num2
12
- Project-URL: Documentation, https://github.com/jqueguiner/words2num2/wiki
13
- Project-URL: Repository, https://github.com/jqueguiner/words2num2.git
14
- Project-URL: Bug Tracker, https://github.com/jqueguiner/words2num2/issues
15
- Keywords: number,word,numbers,words,parse,parser,convert,conversion,i18n,localisation,localization,internationalisation,internationalization,asr,speech,llm
16
- Classifier: Development Status :: 4 - Beta
17
- Classifier: Intended Audience :: Developers
18
- Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.10
20
- Classifier: Programming Language :: Python :: 3.11
21
- Classifier: Programming Language :: Python :: 3.12
22
- Classifier: Programming Language :: Python :: 3.13
23
- Classifier: Programming Language :: Python :: 3.14
24
- Classifier: Programming Language :: Python :: 3.15
25
- Classifier: Topic :: Software Development :: Internationalization
26
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
- Classifier: Topic :: Software Development :: Localization
28
- Classifier: Topic :: Text Processing :: Linguistic
29
- Requires-Python: >=3.10
30
- Description-Content-Type: text/x-rst
31
- License-File: COPYING
32
- Requires-Dist: docopt>=0.6.2
33
- Requires-Dist: num2words2>=0.1.0.dev0
34
- Dynamic: author
35
- Dynamic: home-page
36
- Dynamic: license
37
- Dynamic: license-file
38
- Dynamic: maintainer
39
-
40
1
  words2num2 — words to numbers
41
2
  =============================
42
3
 
@@ -60,43 +21,43 @@ words2num2 — words to numbers
60
21
  :target: https://aur.archlinux.org/packages/python-words2num2
61
22
  :alt: AUR version
62
23
 
63
- .. image:: https://github.com/jqueguiner/words2num2/workflows/CI/badge.svg
64
- :target: https://github.com/jqueguiner/words2num2/actions/workflows/ci.yml
24
+ .. image:: https://github.com/gladiaio/words2num2/workflows/CI/badge.svg
25
+ :target: https://github.com/gladiaio/words2num2/actions/workflows/ci.yml
65
26
  :alt: CI
66
27
 
67
- .. image:: https://github.com/jqueguiner/words2num2/workflows/Lint/badge.svg
68
- :target: https://github.com/jqueguiner/words2num2/actions/workflows/lint.yml
28
+ .. image:: https://github.com/gladiaio/words2num2/workflows/Lint/badge.svg
29
+ :target: https://github.com/gladiaio/words2num2/actions/workflows/lint.yml
69
30
  :alt: Lint
70
31
 
71
- .. image:: https://github.com/jqueguiner/words2num2/workflows/CodeQL/badge.svg
72
- :target: https://github.com/jqueguiner/words2num2/actions/workflows/codeql-analysis.yml
32
+ .. image:: https://github.com/gladiaio/words2num2/workflows/CodeQL/badge.svg
33
+ :target: https://github.com/gladiaio/words2num2/actions/workflows/codeql-analysis.yml
73
34
  :alt: CodeQL
74
35
 
75
- .. image:: https://github.com/jqueguiner/words2num2/workflows/E2E%20Tests/badge.svg
76
- :target: https://github.com/jqueguiner/words2num2/actions/workflows/e2e-tests.yml
36
+ .. image:: https://github.com/gladiaio/words2num2/workflows/E2E%20Tests/badge.svg
37
+ :target: https://github.com/gladiaio/words2num2/actions/workflows/e2e-tests.yml
77
38
  :alt: E2E Tests
78
39
 
79
- .. image:: https://coveralls.io/repos/github/jqueguiner/words2num2/badge.svg?branch=main
80
- :target: https://coveralls.io/github/jqueguiner/words2num2?branch=main
40
+ .. image:: https://coveralls.io/repos/github/gladiaio/words2num2/badge.svg?branch=main
41
+ :target: https://coveralls.io/github/gladiaio/words2num2?branch=main
81
42
  :alt: Coverage
82
43
 
83
- .. image:: https://img.shields.io/github/v/release/jqueguiner/words2num2.svg
84
- :target: https://github.com/jqueguiner/words2num2/releases
44
+ .. image:: https://img.shields.io/github/v/release/gladiaio/words2num2.svg
45
+ :target: https://github.com/gladiaio/words2num2/releases
85
46
  :alt: Latest release
86
47
 
87
- .. image:: https://img.shields.io/github/last-commit/jqueguiner/words2num2.svg
88
- :target: https://github.com/jqueguiner/words2num2/commits/main
48
+ .. image:: https://img.shields.io/github/last-commit/gladiaio/words2num2.svg
49
+ :target: https://github.com/gladiaio/words2num2/commits/main
89
50
  :alt: Last commit
90
51
 
91
- .. image:: https://img.shields.io/github/issues/jqueguiner/words2num2.svg
92
- :target: https://github.com/jqueguiner/words2num2/issues
52
+ .. image:: https://img.shields.io/github/issues/gladiaio/words2num2.svg
53
+ :target: https://github.com/gladiaio/words2num2/issues
93
54
  :alt: Issues
94
55
 
95
56
  .. image:: https://img.shields.io/badge/license-LGPL--2.1-blue.svg
96
- :target: https://github.com/jqueguiner/words2num2/blob/main/COPYING
57
+ :target: https://github.com/gladiaio/words2num2/blob/main/COPYING
97
58
  :alt: License
98
59
 
99
- The inverse of `num2words2 <https://github.com/jqueguiner/num2words2>`_.
60
+ The inverse of `num2words2 <https://github.com/gladiaio/num2words2>`_.
100
61
 
101
62
  ``words2num2`` parses spoken-form numbers — ``"forty-two"``,
102
63
  ``"trois cent quatre"``, ``"二十三"`` — and returns numeric values.
@@ -105,11 +66,21 @@ entries**) and adds a free-text *auto-parse* mode that handles
105
66
  currencies, units, configurable thousands/decimal separators, and
106
67
  ASR/LLM-style mixed text.
107
68
 
69
+ It is **Rust-powered with a thin Python binder**. The whole parsing engine —
70
+ the English grammar, the generic reverse-lookup backend, the sentence walker,
71
+ number-format parsing and auto-parse — runs in a compiled Rust core
72
+ (PyO3/``abi3``); Python only shapes arguments and results. The core embeds the
73
+ num2words2 conversion engine natively, so ``words2num2`` is **self-contained
74
+ and has no runtime dependencies**, while running several times faster than the
75
+ former pure-Python implementation. Output is unchanged — validated against a
76
+ frozen corpus of ~11,000 round-trip cases.
77
+
108
78
  The project is hosted on GitHub_, and the full documentation is available
109
79
  in the Wiki_. Contributions are welcome.
110
80
 
111
- .. _GitHub: https://github.com/jqueguiner/words2num2
112
- .. _Wiki: https://github.com/jqueguiner/words2num2/wiki
81
+ .. _GitHub: https://github.com/gladiaio/words2num2
82
+ .. _Wiki: https://github.com/gladiaio/words2num2/wiki
83
+ .. _GitHub Releases: https://github.com/gladiaio/words2num2/releases
113
84
 
114
85
  Why this library
115
86
  ----------------
@@ -133,13 +104,64 @@ the forward direction. ``words2num2``:
133
104
  * Pluralizes long-form units in expand mode (``5 dollars`` /
134
105
  ``1 dollar``, ``5 feet`` / ``1 foot``, ``5 yen`` / ``1 yen``).
135
106
 
107
+ Performance
108
+ -----------
109
+
110
+ The parsing engine is compiled Rust (PyO3/``abi3``), so there is no
111
+ Python-level tokenising or table walking on the hot path. Typical native
112
+ throughput (Apple M-series, nanoseconds per call, after warmup):
113
+
114
+ .. list-table::
115
+ :header-rows: 1
116
+ :widths: 60 20
117
+
118
+ * - Operation
119
+ - ns/call
120
+ * - English cardinal (``"eight thousand seven hundred sixty-five"``)
121
+ - ~5,900
122
+ * - English ordinal (``"forty-second"``)
123
+ - ~4,100
124
+ * - French cardinal (``"trois cent quatre"``)
125
+ - ~1,900
126
+ * - Russian cardinal (``"сорок два"``)
127
+ - ~1,700
128
+ * - ``parse_number_string("1.234.567,89", lang="de")``
129
+ - ~240
130
+ * - ``auto_parse("$12,345.00")``
131
+ - ~990
132
+
133
+ For the 100+ generic locales, the first call in a given language builds the
134
+ ``{words → number}`` reverse table once (~35 ms) and caches it in the core;
135
+ every call after that is a native lookup. Output is byte-for-byte identical to
136
+ the former pure-Python implementation, validated against a frozen corpus of
137
+ ~11,000 round-trip cases and the full test suite.
138
+
136
139
  Installation
137
140
  ------------
138
141
 
139
- **pip**::
142
+ **pip** (Python 3.10+)::
140
143
 
141
144
  pip install words2num2
142
145
 
146
+ **cargo** (Rust) — the compiled core is published on crates.io as
147
+ `words2num2-core <https://crates.io/crates/words2num2-core>`_::
148
+
149
+ cargo add words2num2-core
150
+
151
+ That's it — the wheel bundles the Python binder and the compiled Rust
152
+ extension, and ``words2num2`` has **no runtime dependencies** (the num2words2
153
+ conversion engine is compiled in, so you do *not* need the num2words2 package).
154
+
155
+ Prebuilt wheels are published for:
156
+
157
+ * **Linux** — x86_64 and aarch64 (manylinux2014)
158
+ * **macOS** — Apple Silicon (arm64); Intel (x86_64) from a later release
159
+ * **Windows** — x86_64
160
+
161
+ On any other platform (or an older release without a matching wheel), pip
162
+ falls back to the source distribution and builds the extension locally — this
163
+ needs a **stable Rust toolchain** (`rustup <https://rustup.rs>`_); nothing else.
164
+
143
165
  **Arch Linux / Manjaro (AUR):**
144
166
 
145
167
  .. code-block:: bash
@@ -153,14 +175,15 @@ Installation
153
175
  cd python-words2num2
154
176
  makepkg -si
155
177
 
156
- **From source**::
178
+ **From source** (needs a stable Rust toolchain and `maturin
179
+ <https://www.maturin.rs>`_)::
157
180
 
158
- git clone https://github.com/jqueguiner/words2num2
181
+ git clone https://github.com/gladiaio/words2num2
159
182
  cd words2num2
160
- pip install -e .
183
+ pip install -e . # builds the Rust extension via maturin
184
+ # or, to produce a wheel: maturin build --release
161
185
 
162
- ``num2words2`` is a runtime dependency for the generic multi-language
163
- backend and is installed automatically.
186
+ Wheels for every version are also attached to the `GitHub Releases`_ page.
164
187
 
165
188
  Quickstart
166
189
  ----------
@@ -362,7 +385,7 @@ Development
362
385
 
363
386
  .. code-block:: bash
364
387
 
365
- git clone https://github.com/jqueguiner/words2num2
388
+ git clone https://github.com/gladiaio/words2num2
366
389
  cd words2num2
367
390
  make install-dev
368
391
  make test # pytest
@@ -0,0 +1,94 @@
1
+ [build-system]
2
+ requires = ["maturin>=1.5,<2.0"]
3
+ build-backend = "maturin"
4
+
5
+ [project]
6
+ name = "words2num2"
7
+ # Static base version. The release CI overrides it from the pushed git tag
8
+ # (see .github/workflows/release.yml); bump here for local source builds.
9
+ version = "0.3.2"
10
+ license = "LGPL-2.1-only"
11
+ license-files = ["COPYING"]
12
+ description = "Rust-powered inverse of num2words2: parse spoken-form numbers back to numeric values across 100+ languages, optimized for ASR/LLM/speech."
13
+ readme = "README.rst"
14
+ requires-python = ">=3.10"
15
+ # Self-contained: the num2words2 conversion engine is embedded in the compiled
16
+ # core (num2words2-core), so there is no runtime dependency on the num2words2
17
+ # package and no docopt (the CLI uses only the standard library).
18
+ dependencies = []
19
+ authors = [
20
+ {name = "Jean-Louis Queguiner", email = "jean-louis.queguiner@gmail.com"}
21
+ ]
22
+ maintainers = [
23
+ {name = "Jean-Louis Queguiner", email = "jean-louis.queguiner@gmail.com"}
24
+ ]
25
+ keywords = ["number", "word", "numbers", "words", "parse", "parser", "convert",
26
+ "conversion", "i18n", "localisation", "localization",
27
+ "internationalisation", "internationalization", "asr", "speech",
28
+ "llm", "rust"]
29
+ classifiers = [
30
+ "Development Status :: 4 - Beta",
31
+ "Intended Audience :: Developers",
32
+ "Programming Language :: Python :: 3",
33
+ "Programming Language :: Python :: 3.10",
34
+ "Programming Language :: Python :: 3.11",
35
+ "Programming Language :: Python :: 3.12",
36
+ "Programming Language :: Python :: 3.13",
37
+ "Programming Language :: Python :: 3.14",
38
+ "Programming Language :: Rust",
39
+ "Topic :: Software Development :: Internationalization",
40
+ "Topic :: Software Development :: Libraries :: Python Modules",
41
+ "Topic :: Software Development :: Localization",
42
+ "Topic :: Text Processing :: Linguistic",
43
+ ]
44
+
45
+ [project.urls]
46
+ Homepage = "https://github.com/gladiaio/words2num2"
47
+ Documentation = "https://github.com/gladiaio/words2num2/wiki"
48
+ Repository = "https://github.com/gladiaio/words2num2.git"
49
+ "Bug Tracker" = "https://github.com/gladiaio/words2num2/issues"
50
+
51
+ [project.scripts]
52
+ words2num2 = "words2num2.__main__:main"
53
+
54
+ # ---- maturin: mixed Rust/Python project -------------------------------------
55
+ # The compiled engine lives in ./rust (vendored crates `words2num2-py`, lib
56
+ # `_rust`, plus its `num2words2-core` dependency); the thin Python binder is
57
+ # ./words2num2. maturin bundles both into a single per-platform wheel. The
58
+ # wheel embeds num2words2-core natively — no lingua-rs models, so it stays
59
+ # small (~4MB), and there is only one variant.
60
+ [tool.maturin]
61
+ manifest-path = "rust/words2num2-py/Cargo.toml"
62
+ python-source = "."
63
+ module-name = "words2num2._rust"
64
+ features = ["pyo3/extension-module"]
65
+ strip = true
66
+
67
+ [tool.isort]
68
+ profile = "black"
69
+ line_length = 88
70
+ skip = ["words2num2/_version.py"]
71
+ multi_line_output = 3
72
+ include_trailing_comma = true
73
+ force_grid_wrap = 0
74
+ use_parentheses = true
75
+ ensure_newline_before_comments = true
76
+
77
+ [tool.black]
78
+ line-length = 88
79
+ target-version = ['py310']
80
+ include = '\.pyi?$'
81
+ exclude = '''
82
+ /(
83
+ \.git
84
+ | \.hg
85
+ | \.mypy_cache
86
+ | \.tox
87
+ | \.venv
88
+ | _build
89
+ | buck-out
90
+ | build
91
+ | dist
92
+ | words2num2/_version.py
93
+ )/
94
+ '''