Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/macos-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions README_TH.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/) เพื่อรับข่าวสารเพิ่มเติม

Expand Down
5 changes: 3 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
4 changes: 4 additions & 0 deletions docs/notes/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/PyThaiNLP/pythainlp/blob/dev/setup.py>`_.
Expand Down
2 changes: 1 addition & 1 deletion pythainlp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = "3.0.0-dev0"
__version__ = "3.0.0"

thai_consonants = "กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรลวศษสหฬอฮ" # 44 chars

Expand Down
8 changes: 4 additions & 4 deletions pythainlp/util/thai.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.0.0-beta0
current_version = 3.0.0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions tests/test_augment.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Thai2fitAug,
LTW2VAug
)
import nltk


class TestTextaugmentPackage(unittest.TestCase):
Expand All @@ -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))
Expand Down
4 changes: 3 additions & 1 deletion tests/test_corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
)
from pythainlp.corpus.util import revise_newmm_default_wordset
from requests import Response
import nltk


class TestCorpusPackage(unittest.TestCase):
Expand Down Expand Up @@ -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(
Expand Down