diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 46c32ddf2..79df394ba 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -47,6 +47,7 @@ jobs: if [ -f docker_requirements.txt ]; then pip install -r docker_requirements.txt; fi pip install deepcut pip install .[full] + python -m nltk.downloader omw-1.4 - name: Test shell: bash -l {0} env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b42e21a35..0a60973e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,7 @@ jobs: if [ -f docker_requirements.txt ]; then pip install -r docker_requirements.txt; fi pip install deepcut pip install .[full] + python -m nltk.downloader omw-1.4 - name: Test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 8f88eb61d..dd42f88c9 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,12 @@ PyThaiNLP เป็นไลบารีภาษาไพทอนสำหร **News** ->Since PyThaiNLP 3.0, We will end support PyThaiNLP on Python 3.6. Python 3.6 users can use PyThaiNLP 2.3.1 +>Since PyThaiNLP 3.0, We will end support PyThaiNLP on Python 3.6. Python 3.6 users can use PyThaiNLP 2.3.2 | Version | Description | Status | |:------:|:--:|:------:| -| [2.3.2](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/445) | -| [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 3.0 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/545) | +| [3.0](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/545) | +| [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 3.1 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/545) | ## Getting Started @@ -134,6 +134,10 @@ thainlp help - Please do fork and create a pull request :) - For style guide and other information, including references to algorithms we use, please refer to our [contributing](https://github.com/PyThaiNLP/pythainlp/blob/dev/CONTRIBUTING.md) page. +## Who uses PyThaiNLP? + +You can read [INTHEWILD.md](https://github.com/PyThaiNLP/pythainlp/blob/dev/INTHEWILD.md). + ## Citations diff --git a/README_TH.md b/README_TH.md index 66a5e9c82..76f4e6c92 100644 --- a/README_TH.md +++ b/README_TH.md @@ -20,8 +20,8 @@ PyThaiNLP เป็นไลบารีภาษาไพทอนสำหร | รุ่น | คำอธิบาย | สถานะ | |:------:|:--:|:------:| -| [2.3.2](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/445) | -| [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 3.0 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/545) | +| [3.0](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/545 | +| [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 3.1 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/545) | ติดตามพวกเราบน [PyThaiNLP Facebook page](https://www.facebook.com/pythainlp/) เพื่อรับข่าวสารเพิ่มเติม diff --git a/SECURITY.md b/SECURITY.md index 3a620ad0f..68c92ddb7 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,8 +4,9 @@ | Version | Supported | | ------- | ------------------ | +| 3.0.x | :white_check_mark: | | 2.3.x | :white_check_mark: | -| 2.2.x | :white_check_mark: | -| 2.1.x | :white_check_mark: | +| 2.2.x | :x: | +| 2.1.x | :x: | | 2.0.x | :x: | | < 2.0 | :x: | diff --git a/docs/notes/installation.rst b/docs/notes/installation.rst index 84b52c8a4..2c5024616 100644 --- a/docs/notes/installation.rst +++ b/docs/notes/installation.rst @@ -27,7 +27,11 @@ where ``extras`` can be - ``mt5`` (to mt5 models for Thai text summarizer) - ``wordnet`` (to support wordnet) - ``spell`` (to support phunspell & symspellpy) + - ``generate`` (to support text generate with umlfit or thai2fit) - ``tltk`` (to support tltk) + - ``textaugment`` (to support text augmentation) + - ``oskut`` (to support OSKUT) + - ``nlpo3`` (to support nlpo3 enging) - ``full`` (install everything) For dependency details, look at `extras` variable in `setup.py `_. diff --git a/pythainlp/__init__.py b/pythainlp/__init__.py index 615b4e97a..dfb9bd5cc 100644 --- a/pythainlp/__init__.py +++ b/pythainlp/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -__version__ = "3.0.0-dev0" +__version__ = "3.0.0" thai_consonants = "กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรลวศษสหฬอฮ" # 44 chars diff --git a/pythainlp/util/thai.py b/pythainlp/util/thai.py index 6db52fc83..6c9fbac4a 100644 --- a/pythainlp/util/thai.py +++ b/pythainlp/util/thai.py @@ -90,16 +90,16 @@ def countthai(text: str, ignore_chars: str = _DEFAULT_IGNORE_CHARS) -> float: from pythainlp.util import countthai - countthai("ไทยเอ็นแอลพี 2.3") + countthai("ไทยเอ็นแอลพี 3.0") # output: 100.0 - countthai("PyThaiNLP 2.3") + countthai("PyThaiNLP 3.0") # output: 0.0 - countthai("ใช้งาน PyThaiNLP 2.3") + countthai("ใช้งาน PyThaiNLP 3.0") # output: 40.0 - countthai("ใช้งาน PyThaiNLP 2.3", ignore_chars="") + countthai("ใช้งาน PyThaiNLP 3.0", ignore_chars="") # output: 30.0 """ if not text or not isinstance(text, str): diff --git a/setup.cfg b/setup.cfg index 5dd1f7025..d3bd97796 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.0.0-beta0 +current_version = 3.0.0 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/setup.py b/setup.py index 864ea38fb..47adb15e5 100644 --- a/setup.py +++ b/setup.py @@ -105,7 +105,7 @@ setup( name="pythainlp", - version="3.0.0-beta0", + version="3.0.0", description="Thai Natural Language Processing library", long_description=readme, long_description_content_type="text/markdown", @@ -154,7 +154,7 @@ ], }, project_urls={ - "Documentation": "https://pythainlp.github.io/docs/2.3/", + "Documentation": "https://pythainlp.github.io/docs/3.0/", "Tutorials": "https://pythainlp.github.io/tutorials/", "Source Code": "https://github.com/PyThaiNLP/pythainlp", "Bug Tracker": "https://github.com/PyThaiNLP/pythainlp/issues", diff --git a/tests/test_augment.py b/tests/test_augment.py index 4048f6d46..253ae14d9 100644 --- a/tests/test_augment.py +++ b/tests/test_augment.py @@ -9,6 +9,7 @@ Thai2fitAug, LTW2VAug ) +import nltk class TestTextaugmentPackage(unittest.TestCase): @@ -17,6 +18,7 @@ def setUp(self): self.text2 = "เราอยู่ที่มหาวิทยาลัยขอนแก่น" def test_WordNetAug(self): + nltk.download('omw-1.4', force=True) # load wordnet wordnetaug = WordNetAug() self.assertIsNotNone(wordnetaug.augment(self.text)) self.assertIsNotNone(wordnetaug.find_synonyms("ผม", pos=None)) diff --git a/tests/test_corpus.py b/tests/test_corpus.py index 792f70fd3..9e23eb5f0 100644 --- a/tests/test_corpus.py +++ b/tests/test_corpus.py @@ -27,6 +27,7 @@ ) from pythainlp.corpus.util import revise_newmm_default_wordset from requests import Response +import nltk class TestCorpusPackage(unittest.TestCase): @@ -120,7 +121,8 @@ def test_ttc(self): self.assertIsNotNone(ttc.unigram_word_freqs()) def test_wordnet(self): - self.assertIsInstance(wordnet.langs(), list) + nltk.download('omw-1.4', force=True) # load wordnet + self.assertIsNotNone(wordnet.langs()) self.assertIn("tha", wordnet.langs()) self.assertEqual(