polyglot3 2026.10.1__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 (152) hide show
  1. polyglot3-2026.10.1/AUTHORS.md +28 -0
  2. polyglot3-2026.10.1/CONTRIBUTING.md +44 -0
  3. polyglot3-2026.10.1/HISTORY.md +57 -0
  4. polyglot3-2026.10.1/LICENSE +680 -0
  5. polyglot3-2026.10.1/MANIFEST.in +6 -0
  6. polyglot3-2026.10.1/Makefile +47 -0
  7. polyglot3-2026.10.1/PKG-INFO +258 -0
  8. polyglot3-2026.10.1/README.md +222 -0
  9. polyglot3-2026.10.1/docs/CLI.md +113 -0
  10. polyglot3-2026.10.1/docs/Concurrency.md +86 -0
  11. polyglot3-2026.10.1/docs/Detection.md +111 -0
  12. polyglot3-2026.10.1/docs/Dev.md +138 -0
  13. polyglot3-2026.10.1/docs/Download.md +88 -0
  14. polyglot3-2026.10.1/docs/Embeddings.md +121 -0
  15. polyglot3-2026.10.1/docs/Installation.md +65 -0
  16. polyglot3-2026.10.1/docs/Makefile +177 -0
  17. polyglot3-2026.10.1/docs/NamedEntityRecognition.md +89 -0
  18. polyglot3-2026.10.1/docs/POS.md +86 -0
  19. polyglot3-2026.10.1/docs/README.md +222 -0
  20. polyglot3-2026.10.1/docs/Sentiment.md +105 -0
  21. polyglot3-2026.10.1/docs/Tokenization.md +100 -0
  22. polyglot3-2026.10.1/docs/api.md +107 -0
  23. polyglot3-2026.10.1/docs/authors.md +2 -0
  24. polyglot3-2026.10.1/docs/conf.py +36 -0
  25. polyglot3-2026.10.1/docs/contributing.md +3 -0
  26. polyglot3-2026.10.1/docs/history.md +2 -0
  27. polyglot3-2026.10.1/docs/index.md +23 -0
  28. polyglot3-2026.10.1/docs/make.bat +242 -0
  29. polyglot3-2026.10.1/docs/requirements.txt +3 -0
  30. polyglot3-2026.10.1/polyglot3/__init__.py +22 -0
  31. polyglot3-2026.10.1/polyglot3/__main__.py +321 -0
  32. polyglot3-2026.10.1/polyglot3/base.py +210 -0
  33. polyglot3-2026.10.1/polyglot3/decorators.py +44 -0
  34. polyglot3-2026.10.1/polyglot3/detect/__init__.py +3 -0
  35. polyglot3-2026.10.1/polyglot3/detect/base.py +140 -0
  36. polyglot3-2026.10.1/polyglot3/detect/langids.py +227 -0
  37. polyglot3-2026.10.1/polyglot3/downloader.py +1399 -0
  38. polyglot3-2026.10.1/polyglot3/load.py +122 -0
  39. polyglot3-2026.10.1/polyglot3/mapping/__init__.py +12 -0
  40. polyglot3-2026.10.1/polyglot3/mapping/base.py +238 -0
  41. polyglot3-2026.10.1/polyglot3/mapping/embeddings.py +327 -0
  42. polyglot3-2026.10.1/polyglot3/mapping/expansion.py +101 -0
  43. polyglot3-2026.10.1/polyglot3/mapping/tests/__init__.py +0 -0
  44. polyglot3-2026.10.1/polyglot3/mapping/tests/test_embeddings.py +79 -0
  45. polyglot3-2026.10.1/polyglot3/mapping/tests/test_expansion.py +95 -0
  46. polyglot3-2026.10.1/polyglot3/mixins.py +166 -0
  47. polyglot3-2026.10.1/polyglot3/tag/__init__.py +17 -0
  48. polyglot3-2026.10.1/polyglot3/tag/base.py +219 -0
  49. polyglot3-2026.10.1/polyglot3/tag/tests/__init__.py +0 -0
  50. polyglot3-2026.10.1/polyglot3/tests/__init__.py +1 -0
  51. polyglot3-2026.10.1/polyglot3/tests/test_utils.py +25 -0
  52. polyglot3-2026.10.1/polyglot3/text.py +483 -0
  53. polyglot3-2026.10.1/polyglot3/tokenize/__init__.py +6 -0
  54. polyglot3-2026.10.1/polyglot3/tokenize/_tables.py +13461 -0
  55. polyglot3-2026.10.1/polyglot3/tokenize/base.py +40 -0
  56. polyglot3-2026.10.1/polyglot3/tokenize/breakiter.py +445 -0
  57. polyglot3-2026.10.1/polyglot3/tokenize/data/LICENSE-ICU +568 -0
  58. polyglot3-2026.10.1/polyglot3/tokenize/data/thaidict.txt.gz +0 -0
  59. polyglot3-2026.10.1/polyglot3/tokenize/tests/__init__.py +0 -0
  60. polyglot3-2026.10.1/polyglot3/tokenize/tests/test_base.py +86 -0
  61. polyglot3-2026.10.1/polyglot3/utils.py +44 -0
  62. polyglot3-2026.10.1/polyglot3.egg-info/PKG-INFO +258 -0
  63. polyglot3-2026.10.1/polyglot3.egg-info/SOURCES.txt +150 -0
  64. polyglot3-2026.10.1/polyglot3.egg-info/dependency_links.txt +1 -0
  65. polyglot3-2026.10.1/polyglot3.egg-info/entry_points.txt +2 -0
  66. polyglot3-2026.10.1/polyglot3.egg-info/requires.txt +5 -0
  67. polyglot3-2026.10.1/polyglot3.egg-info/top_level.txt +1 -0
  68. polyglot3-2026.10.1/pyproject.toml +76 -0
  69. polyglot3-2026.10.1/setup.cfg +4 -0
  70. polyglot3-2026.10.1/tests/__init__.py +1 -0
  71. polyglot3-2026.10.1/tests/fixtures/corpus/ar.jsonl +24 -0
  72. polyglot3-2026.10.1/tests/fixtures/corpus/bg.jsonl +24 -0
  73. polyglot3-2026.10.1/tests/fixtures/corpus/cs.jsonl +24 -0
  74. polyglot3-2026.10.1/tests/fixtures/corpus/edge_cases.jsonl +36 -0
  75. polyglot3-2026.10.1/tests/fixtures/corpus/et.jsonl +24 -0
  76. polyglot3-2026.10.1/tests/fixtures/corpus/fa.jsonl +24 -0
  77. polyglot3-2026.10.1/tests/fixtures/corpus/ga.jsonl +24 -0
  78. polyglot3-2026.10.1/tests/fixtures/corpus/he.jsonl +24 -0
  79. polyglot3-2026.10.1/tests/fixtures/corpus/hi.jsonl +24 -0
  80. polyglot3-2026.10.1/tests/fixtures/corpus/hr.jsonl +24 -0
  81. polyglot3-2026.10.1/tests/fixtures/corpus/hu.jsonl +24 -0
  82. polyglot3-2026.10.1/tests/fixtures/corpus/id.jsonl +24 -0
  83. polyglot3-2026.10.1/tests/fixtures/corpus/lv.jsonl +24 -0
  84. polyglot3-2026.10.1/tests/fixtures/corpus/ms.jsonl +24 -0
  85. polyglot3-2026.10.1/tests/fixtures/corpus/no.jsonl +24 -0
  86. polyglot3-2026.10.1/tests/fixtures/corpus/sk.jsonl +24 -0
  87. polyglot3-2026.10.1/tests/fixtures/corpus/sl.jsonl +24 -0
  88. polyglot3-2026.10.1/tests/fixtures/corpus/sr.jsonl +24 -0
  89. polyglot3-2026.10.1/tests/fixtures/corpus/th.jsonl +48 -0
  90. polyglot3-2026.10.1/tests/fixtures/corpus/tr.jsonl +24 -0
  91. polyglot3-2026.10.1/tests/fixtures/corpus/uk.jsonl +24 -0
  92. polyglot3-2026.10.1/tests/fixtures/corpus/vi.jsonl +24 -0
  93. polyglot3-2026.10.1/tests/fixtures/golden/ar.jsonl +24 -0
  94. polyglot3-2026.10.1/tests/fixtures/golden/bg.jsonl +24 -0
  95. polyglot3-2026.10.1/tests/fixtures/golden/cs.jsonl +24 -0
  96. polyglot3-2026.10.1/tests/fixtures/golden/edge_cases.jsonl +36 -0
  97. polyglot3-2026.10.1/tests/fixtures/golden/et.jsonl +24 -0
  98. polyglot3-2026.10.1/tests/fixtures/golden/fa.jsonl +24 -0
  99. polyglot3-2026.10.1/tests/fixtures/golden/ga.jsonl +24 -0
  100. polyglot3-2026.10.1/tests/fixtures/golden/he.jsonl +24 -0
  101. polyglot3-2026.10.1/tests/fixtures/golden/hi.jsonl +24 -0
  102. polyglot3-2026.10.1/tests/fixtures/golden/hr.jsonl +24 -0
  103. polyglot3-2026.10.1/tests/fixtures/golden/hu.jsonl +24 -0
  104. polyglot3-2026.10.1/tests/fixtures/golden/id.jsonl +24 -0
  105. polyglot3-2026.10.1/tests/fixtures/golden/lv.jsonl +24 -0
  106. polyglot3-2026.10.1/tests/fixtures/golden/ms.jsonl +24 -0
  107. polyglot3-2026.10.1/tests/fixtures/golden/no.jsonl +24 -0
  108. polyglot3-2026.10.1/tests/fixtures/golden/sk.jsonl +24 -0
  109. polyglot3-2026.10.1/tests/fixtures/golden/sl.jsonl +24 -0
  110. polyglot3-2026.10.1/tests/fixtures/golden/sr.jsonl +24 -0
  111. polyglot3-2026.10.1/tests/fixtures/golden/th.jsonl +48 -0
  112. polyglot3-2026.10.1/tests/fixtures/golden/tr.jsonl +24 -0
  113. polyglot3-2026.10.1/tests/fixtures/golden/uk.jsonl +24 -0
  114. polyglot3-2026.10.1/tests/fixtures/golden/vi.jsonl +24 -0
  115. polyglot3-2026.10.1/tests/fixtures/segmentation/META.json +5 -0
  116. polyglot3-2026.10.1/tests/fixtures/segmentation/ar.jsonl +24 -0
  117. polyglot3-2026.10.1/tests/fixtures/segmentation/bg.jsonl +24 -0
  118. polyglot3-2026.10.1/tests/fixtures/segmentation/cs.jsonl +24 -0
  119. polyglot3-2026.10.1/tests/fixtures/segmentation/edge_cases.jsonl +36 -0
  120. polyglot3-2026.10.1/tests/fixtures/segmentation/et.jsonl +24 -0
  121. polyglot3-2026.10.1/tests/fixtures/segmentation/fa.jsonl +24 -0
  122. polyglot3-2026.10.1/tests/fixtures/segmentation/ga.jsonl +24 -0
  123. polyglot3-2026.10.1/tests/fixtures/segmentation/he.jsonl +24 -0
  124. polyglot3-2026.10.1/tests/fixtures/segmentation/hi.jsonl +24 -0
  125. polyglot3-2026.10.1/tests/fixtures/segmentation/hr.jsonl +24 -0
  126. polyglot3-2026.10.1/tests/fixtures/segmentation/hu.jsonl +24 -0
  127. polyglot3-2026.10.1/tests/fixtures/segmentation/id.jsonl +24 -0
  128. polyglot3-2026.10.1/tests/fixtures/segmentation/lv.jsonl +24 -0
  129. polyglot3-2026.10.1/tests/fixtures/segmentation/ms.jsonl +24 -0
  130. polyglot3-2026.10.1/tests/fixtures/segmentation/no.jsonl +24 -0
  131. polyglot3-2026.10.1/tests/fixtures/segmentation/sk.jsonl +24 -0
  132. polyglot3-2026.10.1/tests/fixtures/segmentation/sl.jsonl +24 -0
  133. polyglot3-2026.10.1/tests/fixtures/segmentation/sr.jsonl +24 -0
  134. polyglot3-2026.10.1/tests/fixtures/segmentation/th.jsonl +48 -0
  135. polyglot3-2026.10.1/tests/fixtures/segmentation/tr.jsonl +24 -0
  136. polyglot3-2026.10.1/tests/fixtures/segmentation/uk.jsonl +24 -0
  137. polyglot3-2026.10.1/tests/fixtures/segmentation/vi.jsonl +24 -0
  138. polyglot3-2026.10.1/tests/test_detect.py +81 -0
  139. polyglot3-2026.10.1/tests/test_downloader.py +95 -0
  140. polyglot3-2026.10.1/tests/test_entity_sentiment.py +33 -0
  141. polyglot3-2026.10.1/tests/test_golden.py +50 -0
  142. polyglot3-2026.10.1/tests/test_segmentation.py +34 -0
  143. polyglot3-2026.10.1/tests/test_threading.py +69 -0
  144. polyglot3-2026.10.1/tools/data/build_index.py +50 -0
  145. polyglot3-2026.10.1/tools/data/upload_to_hf.py +48 -0
  146. polyglot3-2026.10.1/tools/fixtures/fetch_corpus.py +103 -0
  147. polyglot3-2026.10.1/tools/fixtures/gen_golden.py +103 -0
  148. polyglot3-2026.10.1/tools/fixtures/gen_icu_fixtures.py +76 -0
  149. polyglot3-2026.10.1/tools/icu_port/build_tables.py +573 -0
  150. polyglot3-2026.10.1/tools/icu_port/fuzz.py +99 -0
  151. polyglot3-2026.10.1/tools/icu_port/rules/sent.txt +83 -0
  152. polyglot3-2026.10.1/tools/icu_port/rules/word.txt +172 -0
@@ -0,0 +1,28 @@
1
+ # Credits
2
+
3
+ ## polyglot3
4
+
5
+ polyglot3 is maintained by **Dcipher Analytics AB** (<info@dcipheranalytics.com>).
6
+
7
+ This repository has been updated by the Dcipher Analytics dev team with help
8
+ from Claude Opus.
9
+
10
+ ## polyglot
11
+
12
+ Many thanks to the authors of the original
13
+ [polyglot](https://github.com/aboSamoor/polyglot), created at the Data
14
+ Science Lab, Stony Brook University, on which polyglot3 is built:
15
+
16
+ - Rami Al-Rfou <rmyeid@gmail.com> (development lead)
17
+ - Yingtao Tian <yittian@cs.stonybrook.edu>
18
+ - All contributors to https://github.com/aboSamoor/polyglot
19
+
20
+ The models come from the research of Rami Al-Rfou, Bryan Perozzi, Vivek
21
+ Kulkarni, Yanqing Chen and Steven Skiena; see the README for citations.
22
+
23
+ ## Third-party data
24
+
25
+ - Tokenization tables and the Thai dictionary are derived from ICU
26
+ (Unicode License V3, `polyglot3/tokenize/data/LICENSE-ICU`).
27
+ - Language detection uses fastText's `lid.176` model through
28
+ fasttext-langdetect.
@@ -0,0 +1,44 @@
1
+ # Contributing
2
+
3
+ Contributions are welcome. Report bugs and propose features at
4
+ https://github.com/dcipheranalytics/polyglot3/issues. For bugs, include your
5
+ operating system, Python version, polyglot3 version and the steps to
6
+ reproduce.
7
+
8
+ ## Development setup
9
+
10
+ 1. Fork and clone the repository:
11
+
12
+ ```bash
13
+ git clone git@github.com:your_name_here/polyglot3.git
14
+ cd polyglot3
15
+ ```
16
+
17
+ 2. Install it in a virtual environment in editable mode:
18
+
19
+ ```bash
20
+ python -m venv .venv && source .venv/bin/activate
21
+ pip install -e ".[test]" ruff
22
+ ```
23
+
24
+ 3. Create a branch, make your changes, then run the checks:
25
+
26
+ ```bash
27
+ ruff format .
28
+ ruff check polyglot3 tests tools
29
+ python -m pytest
30
+ ```
31
+
32
+ Tests that need models skip themselves unless the models are installed
33
+ (see the [developer guide](docs/Dev.md)).
34
+
35
+ 4. Push your branch and open a pull request.
36
+
37
+ ## Pull request guidelines
38
+
39
+ 1. Include tests for bug fixes and new features.
40
+ 2. Update the documentation in `docs/` when behaviour changes.
41
+ 3. The tests must pass on Python 3.9 to 3.13 on Linux, macOS and Windows;
42
+ GitHub Actions runs them for every pull request.
43
+ 4. Tokenization must stay identical to ICU's (see the
44
+ [developer guide](docs/Dev.md)); the NER and POS models depend on it.
@@ -0,0 +1,57 @@
1
+ # History
2
+
3
+ ## 2026.10.1 (2026-10-22)
4
+
5
+ First release as **polyglot3**, by Dcipher Analytics AB.
6
+
7
+ - The package is now imported as `polyglot3` (`from polyglot3.text import Text`)
8
+ and the command is `polyglot3`, so it can be installed next to the original
9
+ `polyglot`. Models, `polyglot_data/` and the `POLYGLOT_*` environment
10
+ variables are unchanged.
11
+ - Python 3.9 to 3.13 only; Python 2 support and `six` removed.
12
+ - Removed the PyICU dependency: word and sentence segmentation use a
13
+ pure-Python port of ICU 78.3's break iterators (including the Thai
14
+ dictionary engine) that reproduces ICU's boundaries.
15
+ - Removed the pycld2 dependency: language detection uses fastText's
16
+ `lid.176` model via fasttext-langdetect. Hebrew is now `he`, not `iw`.
17
+ - Models are downloaded from a new server (Hugging Face) with checksum
18
+ verification; `POLYGLOT_DATA_URL` selects a mirror.
19
+ - Packaging with `pyproject.toml`.
20
+ - Thread-safe: models are loaded once per process even when several threads
21
+ need them at the same time. See the Threads and Concurrency page.
22
+ - Removed morphological analysis and transliteration (models unavailable)
23
+ and the TextBlob leftovers `correct()`, `tokenize()` and `np_counts` (they
24
+ always raised errors).
25
+ - Bug fixes: garbled tokens after emoji and other non-BMP characters; the
26
+ `sentiment` subcommand did nothing; entity sentiment only used the first
27
+ polar word; `Embedding.normalize_words()` failed on expanded vocabularies;
28
+ `Downloader.status()` returned `None` for a custom download directory;
29
+ `Downloader.supported_language()` crashed; the CLI closed stdin repeatedly
30
+ on Python 3.13.
31
+
32
+ ## polyglot 16.07.04 (2016-07-03)
33
+
34
+ - New features:
35
+ - Support Transfer POS Tagging.
36
+ - Support supplying `hint_language_code` for `Text`.
37
+ - Bug fixes:
38
+ - Improve sentence serialization (PR #34)
39
+ - Fix rare unicode encode error (PR #35)
40
+ - Fix transliteration from languages other than English (PR #46)
41
+ - Add link to Github in README (PR #49)
42
+ - Make handling of paths more coherent (PR #55)
43
+ - Fix normalizing embedding in place for NER corrupts the features of POS
44
+ (issue #60, PR #62)
45
+
46
+ ## polyglot 15.10.03 (2015-10-03)
47
+
48
+ - Change the polyglot models mirror to Stony Brook University DSL lab instead
49
+ of Google cloud storage.
50
+
51
+ ## polyglot 15.5.2 (2015-05-02)
52
+
53
+ - Polyglot is feature complete.
54
+
55
+ ## polyglot 14.11 (2014-01-11)
56
+
57
+ - First release on PyPI.