gngram-lookup 0.2.2__tar.gz → 0.2.3__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.
- {gngram_lookup-0.2.2 → gngram_lookup-0.2.3}/PKG-INFO +5 -3
- {gngram_lookup-0.2.2 → gngram_lookup-0.2.3}/README.md +1 -1
- {gngram_lookup-0.2.2 → gngram_lookup-0.2.3}/gngram_counter/lookup.py +2 -0
- {gngram_lookup-0.2.2 → gngram_lookup-0.2.3}/gngram_counter/normalize.py +2 -0
- {gngram_lookup-0.2.2 → gngram_lookup-0.2.3}/pyproject.toml +2 -2
- gngram_lookup-0.2.3/setup.py +35 -0
- gngram_lookup-0.2.2/setup.py +0 -35
- {gngram_lookup-0.2.2 → gngram_lookup-0.2.3}/LICENSE +0 -0
- {gngram_lookup-0.2.2 → gngram_lookup-0.2.3}/gngram_counter/__init__.py +0 -0
- {gngram_lookup-0.2.2 → gngram_lookup-0.2.3}/gngram_counter/cli.py +0 -0
- {gngram_lookup-0.2.2 → gngram_lookup-0.2.3}/gngram_counter/data.py +0 -0
- {gngram_lookup-0.2.2 → gngram_lookup-0.2.3}/gngram_counter/download_data.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: gngram-lookup
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Static Hash-Based Lookup for Google Ngram Frequencies
|
|
5
5
|
Home-page: https://github.com/craigtrim/gngram-lookup
|
|
6
6
|
License: Proprietary
|
|
@@ -9,7 +9,7 @@ Author: Craig Trim
|
|
|
9
9
|
Author-email: craigtrim@gmail.com
|
|
10
10
|
Maintainer: Craig Trim
|
|
11
11
|
Maintainer-email: craigtrim@gmail.com
|
|
12
|
-
Requires-Python: >=3.
|
|
12
|
+
Requires-Python: >=3.9,<4.0
|
|
13
13
|
Classifier: Development Status :: 4 - Beta
|
|
14
14
|
Classifier: Intended Audience :: Developers
|
|
15
15
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -17,6 +17,8 @@ Classifier: License :: Other/Proprietary License
|
|
|
17
17
|
Classifier: Natural Language :: English
|
|
18
18
|
Classifier: Operating System :: OS Independent
|
|
19
19
|
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
22
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
23
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
24
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
@@ -33,7 +35,7 @@ Description-Content-Type: text/markdown
|
|
|
33
35
|
[](https://pepy.tech/project/gngram-lookup)
|
|
34
36
|
[](https://pepy.tech/project/gngram-lookup)
|
|
35
37
|
[](https://github.com/craigtrim/gngram-lookup/tree/main/tests)
|
|
36
|
-
[](https://www.python.org/downloads/)
|
|
37
39
|
|
|
38
40
|
Word frequency from 500 years of books. O(1) lookup. 5 million words.
|
|
39
41
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://pepy.tech/project/gngram-lookup)
|
|
5
5
|
[](https://pepy.tech/project/gngram-lookup)
|
|
6
6
|
[](https://github.com/craigtrim/gngram-lookup/tree/main/tests)
|
|
7
|
-
[](https://www.python.org/downloads/)
|
|
8
8
|
|
|
9
9
|
Word frequency from 500 years of books. O(1) lookup. 5 million words.
|
|
10
10
|
|
|
@@ -9,6 +9,8 @@ contains pure alphabetic words, so contractions and their suffix parts
|
|
|
9
9
|
(n't, 'll, etc.) are absent — but the stems are present.
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
12
14
|
import hashlib
|
|
13
15
|
from functools import lru_cache
|
|
14
16
|
from typing import TypedDict
|
|
@@ -6,6 +6,8 @@ transformations to ensure consistent matching against the ngram corpus.
|
|
|
6
6
|
Ported from bnc-lookup normalize.py.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
9
11
|
# Unicode characters that should normalize to ASCII apostrophe (U+0027)
|
|
10
12
|
# Ordered by likelihood of occurrence in English text
|
|
11
13
|
APOSTROPHE_VARIANTS = (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "gngram-lookup"
|
|
3
3
|
packages = [{include = "gngram_counter"}]
|
|
4
|
-
version = "0.2.
|
|
4
|
+
version = "0.2.3"
|
|
5
5
|
description = "Static Hash-Based Lookup for Google Ngram Frequencies"
|
|
6
6
|
authors = ["Craig Trim <craigtrim@gmail.com>"]
|
|
7
7
|
maintainers = ["Craig Trim <craigtrim@gmail.com>"]
|
|
@@ -39,7 +39,7 @@ gngram-freq = "gngram_counter.cli:gngram_freq"
|
|
|
39
39
|
generate-setup-file = true
|
|
40
40
|
|
|
41
41
|
[tool.poetry.dependencies]
|
|
42
|
-
python = "^3.
|
|
42
|
+
python = "^3.9"
|
|
43
43
|
polars = "^1.0"
|
|
44
44
|
pyarrow = "^18.0"
|
|
45
45
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
from setuptools import setup
|
|
3
|
+
|
|
4
|
+
packages = \
|
|
5
|
+
['gngram_counter']
|
|
6
|
+
|
|
7
|
+
package_data = \
|
|
8
|
+
{'': ['*']}
|
|
9
|
+
|
|
10
|
+
install_requires = \
|
|
11
|
+
['polars>=1.0,<2.0', 'pyarrow>=18.0,<19.0']
|
|
12
|
+
|
|
13
|
+
entry_points = \
|
|
14
|
+
{'console_scripts': ['gngram-exists = gngram_counter.cli:gngram_exists',
|
|
15
|
+
'gngram-freq = gngram_counter.cli:gngram_freq']}
|
|
16
|
+
|
|
17
|
+
setup_kwargs = {
|
|
18
|
+
'name': 'gngram-lookup',
|
|
19
|
+
'version': '0.2.3',
|
|
20
|
+
'description': 'Static Hash-Based Lookup for Google Ngram Frequencies',
|
|
21
|
+
'long_description': "# gngram-lookup\n\n[](https://badge.fury.io/py/gngram-lookup)\n[](https://pepy.tech/project/gngram-lookup)\n[](https://pepy.tech/project/gngram-lookup)\n[](https://github.com/craigtrim/gngram-lookup/tree/main/tests)\n[](https://www.python.org/downloads/)\n\nWord frequency from 500 years of books. O(1) lookup. 5 million words.\n\n## Install\n\n```bash\npip install gngram-lookup\npython -m gngram_lookup.download_data\n```\n\n## Python\n\n```python\nimport gngram_lookup as ng\n\nng.exists('computer') # True\nng.exists('xyznotaword') # False\n\nng.frequency('computer')\n# {'peak_tf': 2000, 'peak_df': 2000, 'sum_tf': 892451, 'sum_df': 312876}\n\nng.batch_frequency(['the', 'algorithm', 'xyznotaword'])\n# {'the': {...}, 'algorithm': {...}, 'xyznotaword': None}\n```\n\n## CLI\n\n```bash\ngngram-exists computer # True, exit 0\ngngram-exists xyznotaword # False, exit 1\n\ngngram-freq computer\n# peak_tf_decade: 2000\n# peak_df_decade: 2000\n# sum_tf: 892451\n# sum_df: 312876\n```\n\n## Docs\n\n- [API Reference](https://github.com/craigtrim/gngram-lookup/blob/main/docs/api.md)\n- [CLI Reference](https://github.com/craigtrim/gngram-lookup/blob/main/docs/cli.md)\n- [Data Format](https://github.com/craigtrim/gngram-lookup/blob/main/docs/data-format.md)\n- [Use Cases](https://github.com/craigtrim/gngram-lookup/blob/main/docs/use-cases.md)\n- [Development](https://github.com/craigtrim/gngram-lookup/blob/main/docs/development.md)\n\n## See Also\n\n- [bnc-lookup](https://pypi.org/project/bnc-lookup/) - O(1) lookup for British National Corpus\n- [wordnet-lookup](https://pypi.org/project/wordnet-lookup/) - O(1) lookup for WordNet\n\n## Attribution\n\nData derived from the [Google Books Ngram](https://books.google.com/ngrams) dataset.\n\n## License\n\nProprietary. See [LICENSE](https://github.com/craigtrim/gngram-lookup/blob/main/LICENSE).\n",
|
|
22
|
+
'author': 'Craig Trim',
|
|
23
|
+
'author_email': 'craigtrim@gmail.com',
|
|
24
|
+
'maintainer': 'Craig Trim',
|
|
25
|
+
'maintainer_email': 'craigtrim@gmail.com',
|
|
26
|
+
'url': 'https://github.com/craigtrim/gngram-lookup',
|
|
27
|
+
'packages': packages,
|
|
28
|
+
'package_data': package_data,
|
|
29
|
+
'install_requires': install_requires,
|
|
30
|
+
'entry_points': entry_points,
|
|
31
|
+
'python_requires': '>=3.9,<4.0',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
setup(**setup_kwargs)
|
gngram_lookup-0.2.2/setup.py
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
from setuptools import setup
|
|
3
|
-
|
|
4
|
-
packages = \
|
|
5
|
-
['gngram_counter']
|
|
6
|
-
|
|
7
|
-
package_data = \
|
|
8
|
-
{'': ['*']}
|
|
9
|
-
|
|
10
|
-
install_requires = \
|
|
11
|
-
['polars>=1.0,<2.0', 'pyarrow>=18.0,<19.0']
|
|
12
|
-
|
|
13
|
-
entry_points = \
|
|
14
|
-
{'console_scripts': ['gngram-exists = gngram_counter.cli:gngram_exists',
|
|
15
|
-
'gngram-freq = gngram_counter.cli:gngram_freq']}
|
|
16
|
-
|
|
17
|
-
setup_kwargs = {
|
|
18
|
-
'name': 'gngram-lookup',
|
|
19
|
-
'version': '0.2.2',
|
|
20
|
-
'description': 'Static Hash-Based Lookup for Google Ngram Frequencies',
|
|
21
|
-
'long_description': "# gngram-lookup\n\n[](https://badge.fury.io/py/gngram-lookup)\n[](https://pepy.tech/project/gngram-lookup)\n[](https://pepy.tech/project/gngram-lookup)\n[](https://github.com/craigtrim/gngram-lookup/tree/main/tests)\n[](https://www.python.org/downloads/)\n\nWord frequency from 500 years of books. O(1) lookup. 5 million words.\n\n## Install\n\n```bash\npip install gngram-lookup\npython -m gngram_lookup.download_data\n```\n\n## Python\n\n```python\nimport gngram_lookup as ng\n\nng.exists('computer') # True\nng.exists('xyznotaword') # False\n\nng.frequency('computer')\n# {'peak_tf': 2000, 'peak_df': 2000, 'sum_tf': 892451, 'sum_df': 312876}\n\nng.batch_frequency(['the', 'algorithm', 'xyznotaword'])\n# {'the': {...}, 'algorithm': {...}, 'xyznotaword': None}\n```\n\n## CLI\n\n```bash\ngngram-exists computer # True, exit 0\ngngram-exists xyznotaword # False, exit 1\n\ngngram-freq computer\n# peak_tf_decade: 2000\n# peak_df_decade: 2000\n# sum_tf: 892451\n# sum_df: 312876\n```\n\n## Docs\n\n- [API Reference](https://github.com/craigtrim/gngram-lookup/blob/main/docs/api.md)\n- [CLI Reference](https://github.com/craigtrim/gngram-lookup/blob/main/docs/cli.md)\n- [Data Format](https://github.com/craigtrim/gngram-lookup/blob/main/docs/data-format.md)\n- [Use Cases](https://github.com/craigtrim/gngram-lookup/blob/main/docs/use-cases.md)\n- [Development](https://github.com/craigtrim/gngram-lookup/blob/main/docs/development.md)\n\n## See Also\n\n- [bnc-lookup](https://pypi.org/project/bnc-lookup/) - O(1) lookup for British National Corpus\n- [wordnet-lookup](https://pypi.org/project/wordnet-lookup/) - O(1) lookup for WordNet\n\n## Attribution\n\nData derived from the [Google Books Ngram](https://books.google.com/ngrams) dataset.\n\n## License\n\nProprietary. See [LICENSE](https://github.com/craigtrim/gngram-lookup/blob/main/LICENSE).\n",
|
|
22
|
-
'author': 'Craig Trim',
|
|
23
|
-
'author_email': 'craigtrim@gmail.com',
|
|
24
|
-
'maintainer': 'Craig Trim',
|
|
25
|
-
'maintainer_email': 'craigtrim@gmail.com',
|
|
26
|
-
'url': 'https://github.com/craigtrim/gngram-lookup',
|
|
27
|
-
'packages': packages,
|
|
28
|
-
'package_data': package_data,
|
|
29
|
-
'install_requires': install_requires,
|
|
30
|
-
'entry_points': entry_points,
|
|
31
|
-
'python_requires': '>=3.11,<4.0',
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
setup(**setup_kwargs)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|