Skip to content

Commit 4ea874d

Browse files
authored
Merge pull request #192 from PyThaiNLP/2.0
PyThaiNLP 2.0.2
2 parents a6a7717 + 3c2de29 commit 4ea874d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1861
-913
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ install:
1818

1919
os:
2020
- linux
21+
2122
# command to run tests, e.g. python setup.py test
2223
script:
2324
coverage run --source=pythainlp setup.py test
25+
2426
after_success:
2527
coveralls
2628

CONTRIBUTING.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@ We use the famous [gitflow](http://nvie.com/posts/a-successful-git-branching-mod
1919

2020
## Code Guidelines
2121

22-
- Use [PEP8](http://www.python.org/dev/peps/pep-0008/);
22+
- Follows [PEP8](http://www.python.org/dev/peps/pep-0008/), use [black](https://github.com/ambv/black);
2323
- Write tests for your new features (please see "Tests" topic below);
2424
- Always remember that [commented code is dead
2525
code](http://www.codinghorror.com/blog/2008/07/coding-without-comments.html);
2626
- Name identifiers (variables, classes, functions, module names) with meaningful
2727
and pronounceable names (`x` is always wrong);
28-
- When manipulating strings, use [Python's new-style
29-
formatting](http://docs.python.org/library/string.html#format-string-syntax)
30-
(`'{} = {}'.format(a, b)` instead of `'%s = %s' % (a, b)`);
28+
- When manipulating strings, use [f-String](https://www.python.org/dev/peps/pep-0498/)
29+
(use `"{a} = {b}"`, instead of `"{} = {}".format(a, b)` and `"%s = %s' % (a, b)"`);
3130
- All `#TODO` comments should be turned into issues (use our
3231
[GitHub issue system](https://github.com/PyThaiNLP/pythainlp/));
3332
- Run all tests before pushing (just execute `tox`) so you will know if your

Makefile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ help:
2828

2929
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
3030

31-
3231
clean-build: ## remove build artifacts
3332
rm -fr build/
3433
rm -fr dist/
@@ -51,19 +50,16 @@ lint: ## check style with flake8
5150
flake8 pythainlp tests
5251

5352
test: ## run tests quickly with the default Python
54-
55-
python setup.py test
53+
python setup.py test
5654

5755
test-all: ## run tests on every Python version with tox
5856
tox
5957

6058
coverage: ## check code coverage quickly with the default Python
61-
62-
coverage run --source pythainlp setup.py test
63-
64-
coverage report -m
65-
coverage html
66-
$(BROWSER) htmlcov/index.html
59+
coverage run --source pythainlp setup.py test
60+
coverage report -m
61+
coverage html
62+
$(BROWSER) htmlcov/index.html
6763

6864
release: clean ## package and upload a release
6965
python setup.py sdist upload

README-pypi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![PyThaiNLP Logo](https://avatars0.githubusercontent.com/u/32934255?s=200&v=4)
22

3-
# PyThaiNLP 2.0
3+
# PyThaiNLP 2.0.2
44

55
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/cb946260c87a4cc5905ca608704406f7)](https://www.codacy.com/app/pythainlp/pythainlp_2?utm_source=github.com&utm_medium=referral&utm_content=PyThaiNLP/pythainlp&utm_campaign=Badge_Grade)[![pypi](https://img.shields.io/pypi/v/pythainlp.svg)](https://pypi.python.org/pypi/pythainlp)
66
[![Build Status](https://travis-ci.org/PyThaiNLP/pythainlp.svg?branch=develop)](https://travis-ci.org/PyThaiNLP/pythainlp)
@@ -12,9 +12,9 @@ PyThaiNLP is a Python library for natural language processing (NLP) of Thai lang
1212

1313
PyThaiNLP includes Thai word tokenizers, transliterators, soundex converters, part-of-speech taggers, and spell checkers.
1414

15-
📖 For details on upgrading from PyThaiNLP 1.7 to PyThaiNLP 2.0, see [From PyThaiNLP 1.7 to PyThaiNLP 2.0](https://thainlp.org/pythainlp/docs/2.0/notes/pythainlp-1_7-2_0.html)
15+
📖 [Upgrading from PyThaiNLP 1.7 to 2.0](https://thainlp.org/pythainlp/docs/2.0/notes/pythainlp-1_7-2_0.html)
1616

17-
📖 For ThaiNER user after upgrading from PyThaiNLP 1.7 to PyThaiNLP 2.0, see [Upgrade ThaiNER from PyThaiNLP 1.7 to PyThaiNLP 2.0](https://github.com/PyThaiNLP/pythainlp/wiki/Upgrade-ThaiNER-from-PyThaiNLP-1.7-to-PyThaiNLP-2.0)
17+
📖 [Upgrade ThaiNER from PyThaiNLP 1.7 to 2.0](https://github.com/PyThaiNLP/pythainlp/wiki/Upgrade-ThaiNER-from-PyThaiNLP-1.7-to-PyThaiNLP-2.0)
1818

1919
📫 follow us on Facebook [Pythainlp](https://www.facebook.com/pythainlp/)
2020

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ Thai Natural Language Processing in Python.
1515
PyThaiNLP is a Python package for text processing and linguistic analysis, similar to `nltk` but with focus on Thai language.
1616

1717
- [Current PyThaiNLP stable release is 2.0](https://github.com/PyThaiNLP/pythainlp/tree/master)
18-
- PyThaiNLP 2.0 will support only Python 3.6+. Some functions may work with older version of Python 3, but it is not well-tested and will not be supported. See [PyThaiNLP 2.0 change log](https://github.com/PyThaiNLP/pythainlp/issues/118).
19-
- Python 2 users can use PyThaiNLP 1.6, our latest released that tested with Python 2.7.
18+
- PyThaiNLP 2.0 supports Python 3.6+. Some functions may work with older version of Python 3, but it is not well-tested and will not be supported. See [PyThaiNLP 2.0 change log](https://github.com/PyThaiNLP/pythainlp/issues/118).
19+
- Python 2.7+ users can use PyThaiNLP 1.6.
2020

21-
**This is a document for development branch (post 1.7.x). Things will break. For a stable branch document, see [master](https://github.com/PyThaiNLP/pythainlp/tree/master).**
21+
**This is a document for development branch (post 2.0). Things will break. For a stable branch document, see [master](https://github.com/PyThaiNLP/pythainlp/tree/master).**
2222

23-
📫 follow us on Facebook [Pythainlp](https://www.facebook.com/pythainlp/)
23+
📫 follow us on Facebook [PyThaiNLP](https://www.facebook.com/pythainlp/)
2424

2525
## Capabilities
2626

@@ -34,7 +34,7 @@ PyThaiNLP is a Python package for text processing and linguistic analysis, simil
3434
- Thai misspellings detection and spelling correction (```spell```)
3535
- Thai soundex (```lk82```, ```udom83```, ```metasound```)
3636
- Thai WordNet wrapper
37-
- and much more - see [examples](https://github.com/PyThaiNLP/pythainlp/tree/dev/examples).
37+
- and much more - see examples in [PyThaiNLP Get Started notebook](https://github.com/PyThaiNLP/pythainlp/blob/dev/notebooks/pythainlp-get-started.ipynb).
3838

3939
## Installation
4040

@@ -102,13 +102,10 @@ PyThaiNLP เป็นไลบารีภาษาไพทอนเพื่
102102

103103
> เพราะโลกขับเคลื่อนต่อไปด้วยการแบ่งปัน
104104
105-
รองรับ Python 3.6 ขึ้นไป
105+
- PyThaiNLP 2.0 รองรับ Python 3.6 ขึ้นไป
106+
- ผู้ใช้ Python 2.7+ ยังสามารถใช้ PyThaiNLP 1.6 ได้
106107

107-
- ตั้งแต่รุ่น 1.7 PyThaiNLP จะเลิกสนับสนุน Python 2 (บางฟังก์ชันอาจยังทำงานได้ แต่จะไม่ได้รับการสนับสนุน)
108-
- ตั้งแต่รุ่น 2.0 จะยุติการรองรับ Python 2 ทั้งหมด
109-
- ผู้ใช้ Python 2 ยังสามารถใช้ PyThaiNLP 1.6 ได้
110-
111-
**เอกสารนี้สำหรับรุ่นพัฒนา (หลัง 1.7.x) อาจมีการเปลี่ยนแปลงได้ตลอด สำหรับเอกสารรุ่นเสถียร ดูที่ [master](https://github.com/PyThaiNLP/pythainlp/tree/master).**
108+
**เอกสารนี้สำหรับรุ่นพัฒนา (หลัง 2.0) อาจมีการเปลี่ยนแปลงได้ตลอด สำหรับเอกสารรุ่นเสถียร ดูที่ [master](https://github.com/PyThaiNLP/pythainlp/tree/master).**
112109

113110
📫 ติดตามข่าวสารได้ที่ Facebook [Pythainlp](https://www.facebook.com/pythainlp/)
114111

@@ -125,7 +122,7 @@ PyThaiNLP เป็นไลบารีภาษาไพทอนเพื่
125122
- ตรวจคำสะกดผิดในภาษาไทย (```spell```)
126123
- soundex ภาษาไทย (```lk82```, ```udom83```, ```metasound```)
127124
- Thai WordNet wrapper
128-
- และอื่น ๆ [ดูตัวอย่าง](https://github.com/PyThaiNLP/pythainlp/tree/dev/examples)
125+
- และอื่น ๆ ดูตัวอย่างได้ใน [PyThaiNLP Get Started notebook](https://github.com/PyThaiNLP/pythainlp/blob/dev/notebooks/pythainlp-get-started.ipynb)
129126

130127
## ติดตั้ง
131128

bin/pythainlp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ elif args.soundex!=None:
4545
args.engine="lk82"
4646
print(soundex(args.soundex, engine=args.engine))
4747
else:
48-
print("PyThaiNLP 2.0")
48+
print("PyThaiNLP 2.0.2")

conda.recipe/meta-old.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

conda.recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set version = "1.7.2" %}
1+
{% set version = "2.0.2" %}
22

33
package:
44
name: pythainlp

docs/api/spell.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,4 @@ Modules
88
-------
99

1010
.. autofunction:: spell
11-
.. autofunction:: pythainlp.spell.pn.spell
12-
.. autofunction:: pythainlp.spell.pn.prob
13-
.. autofunction:: pythainlp.spell.pn.correct
14-
.. autofunction:: pythainlp.spell.pn.known
15-
.. autofunction:: pythainlp.spell.pn.dictionary
11+
.. autofunction:: correct

docs/api/util.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Modules
1414
.. autofunction:: digit_to_text
1515
.. autofunction:: eng_to_thai
1616
.. autofunction:: find_keyword
17-
.. autofunction:: is_thai
18-
.. autofunction:: is_thaichar
19-
.. autofunction:: is_thaiword
17+
.. autofunction:: countthai
18+
.. autofunction:: isthai
19+
.. autofunction:: isthaichar
2020
.. autofunction:: normalize
2121
.. autofunction:: now_reign_year
2222
.. autofunction:: num_to_thaiword

0 commit comments

Comments
 (0)