Skip to content

Commit 7012c9d

Browse files
authored
Merge pull request #196 from PyThaiNLP/dev
Update to v2.0.3
2 parents 4ea874d + efc515f commit 7012c9d

File tree

19 files changed

+19910
-269
lines changed

19 files changed

+19910
-269
lines changed

README-pypi.md

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

3-
# PyThaiNLP 2.0.2
4-
5-
[![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)
6-
[![Build Status](https://travis-ci.org/PyThaiNLP/pythainlp.svg?branch=develop)](https://travis-ci.org/PyThaiNLP/pythainlp)
7-
[![Build status](https://ci.appveyor.com/api/projects/status/9g3mfcwchi8em40x?svg=true)](https://ci.appveyor.com/project/wannaphongcom/pythainlp-9y1ch)
8-
[![Coverage Status](https://coveralls.io/repos/github/PyThaiNLP/pythainlp/badge.svg?branch=dev)](https://coveralls.io/github/PyThaiNLP/pythainlp?branch=dev)
9-
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
3+
# PyThaiNLP 2.0.3
104

115
PyThaiNLP is a Python library for natural language processing (NLP) of Thai language.
126

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

15-
📖 [Upgrading from PyThaiNLP 1.7 to 2.0](https://thainlp.org/pythainlp/docs/2.0/notes/pythainlp-1_7-2_0.html)
16-
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)
18-
19-
📫 follow us on Facebook [Pythainlp](https://www.facebook.com/pythainlp/)
9+
📫 follow us on Facebook [PyThaiNLP](https://www.facebook.com/pythainlp/)
2010

2111
## What's new in version 2.0 ?
2212

@@ -28,8 +18,11 @@ PyThaiNLP includes Thai word tokenizers, transliterators, soundex converters, pa
2818
- Remove sentiment analysis
2919
- Improved word_tokenize (newmm, mm) and dict_word_tokenize
3020
- Improved POS-tagging
31-
- More and improved examples
32-
- see [PyThaiNLP 2.0 change log](https://github.com/PyThaiNLP/pythainlp/issues/118)
21+
- See examples in [Get Started notebook](https://github.com/PyThaiNLP/pythainlp/blob/dev/notebooks/pythainlp-get-started.ipynb)
22+
- [Full change log](https://github.com/PyThaiNLP/pythainlp/issues/118)
23+
- [Upgrading from 1.7](https://thainlp.org/pythainlp/docs/2.0/notes/pythainlp-1_7-2_0.html)
24+
- [Upgrade ThaiNER from 1.7](https://github.com/PyThaiNLP/pythainlp/wiki/Upgrade-ThaiNER-from-PyThaiNLP-1.7-to-PyThaiNLP-2.0)
25+
3326

3427
## Install
3528

@@ -62,8 +55,8 @@ Install it with pip, for example: `pip install marisa_trie‑0.7.5‑cp36‑cp36
6255

6356
## Links
6457

65-
- User guide : [English](https://colab.research.google.com/drive/1MQ10D1mJC5r1vQAHcj4ShoRS14vz8ZF-) , [ภาษาไทย](https://colab.research.google.com/drive/1rEkB2Dcr1UAKPqz4bCghZV7pXx2qxf89)
58+
- User guide: [English](https://github.com/PyThaiNLP/pythainlp/blob/dev/notebooks/pythainlp-get-started.ipynb), [ภาษาไทย](https://colab.research.google.com/drive/1rEkB2Dcr1UAKPqz4bCghZV7pXx2qxf89)
6659
- Docs: https://thainlp.org/pythainlp/docs/2.0/
6760
- GitHub: https://github.com/PyThaiNLP/pythainlp
6861
- Issues: https://github.com/PyThaiNLP/pythainlp/issues
69-
- Facebook : [Pythainlp](https://www.facebook.com/pythainlp/)
62+
- Facebook: [PyThaiNLP](https://www.facebook.com/pythainlp/)

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ Thai Natural Language Processing in Python.
1414

1515
PyThaiNLP is a Python package for text processing and linguistic analysis, similar to `nltk` but with focus on Thai language.
1616

17-
- [Current PyThaiNLP stable release is 2.0](https://github.com/PyThaiNLP/pythainlp/tree/master)
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.
17+
**This is a document for development branch (post 2.0). Things will break.**
2018

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).**
19+
- The latest stable release is [2.0.3](https://github.com/PyThaiNLP/pythainlp/tree/master)
20+
- PyThaiNLP 2 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 [change log](https://github.com/PyThaiNLP/pythainlp/issues/118).
21+
- [Upgrading from 1.7](https://thainlp.org/pythainlp/docs/2.0/notes/pythainlp-1_7-2_0.html)
22+
- [Upgrade ThaiNER from 1.7](https://github.com/PyThaiNLP/pythainlp/wiki/Upgrade-ThaiNER-from-PyThaiNLP-1.7-to-PyThaiNLP-2.0)
23+
- Python 2.7+ users can use PyThaiNLP 1.6.
2224

2325
📫 follow us on Facebook [PyThaiNLP](https://www.facebook.com/pythainlp/)
2426

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

103105
> เพราะโลกขับเคลื่อนต่อไปด้วยการแบ่งปัน
104106
105-
- PyThaiNLP 2.0 รองรับ Python 3.6 ขึ้นไป
106-
- ผู้ใช้ Python 2.7+ ยังสามารถใช้ PyThaiNLP 1.6 ได้
107+
**เอกสารนี้สำหรับรุ่นพัฒนา อาจมีการเปลี่ยนแปลงได้ตลอด**
107108

108-
**เอกสารนี้สำหรับรุ่นพัฒนา (หลัง 2.0) อาจมีการเปลี่ยนแปลงได้ตลอด สำหรับเอกสารรุ่นเสถียร ดูที่ [master](https://github.com/PyThaiNLP/pythainlp/tree/master).**
109+
- รุ่นเสถียรล่าสุดคือรุ่น [2.0.3](https://github.com/PyThaiNLP/pythainlp/tree/master)
110+
- PyThaiNLP 2 รองรับ Python 3.6 ขึ้นไป
111+
- ผู้ใช้ Python 2.7+ ยังสามารถใช้ PyThaiNLP 1.6 ได้
109112

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

bin/pythainlp

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,46 @@
11
#!python3
22
# -*- coding: utf-8 -*-
3+
4+
_VERSION = "2.0.3"
5+
36
import argparse
7+
48
parser = argparse.ArgumentParser()
5-
parser.add_argument("-t","--text",default=None, help="text",type=str)
6-
parser.add_argument("-seg", "--segment", help="word segment",action="store_true")
7-
parser.add_argument("-c", "--corpus", help="mange corpus",action="store_true")
8-
parser.add_argument("-pos", "--postag", help="postag",action="store_true")
9-
parser.add_argument("-soundex", "--soundex", help="soundex",default=None)
10-
parser.add_argument("-e","--engine",default="newmm", help="the engine",type=str)
11-
parser.add_argument("-pos-e","--postag_engine",default="perceptron", help="the engine for word tokenize",type=str)
12-
parser.add_argument("-pos-c","--postag_corpus",default="orchid", help="corpus for postag",type=str)
9+
parser.add_argument("-t", "--text", default=None, help="text", type=str)
10+
parser.add_argument("-seg", "--segment", help="word segment", action="store_true")
11+
parser.add_argument("-c", "--corpus", help="mange corpus", action="store_true")
12+
parser.add_argument("-pos", "--postag", help="postag", action="store_true")
13+
parser.add_argument("-soundex", "--soundex", help="soundex", default=None)
14+
parser.add_argument("-e", "--engine", default="newmm", help="the engine", type=str)
15+
parser.add_argument("-pos-e", "--postag_engine", default="perceptron", help="the engine for word tokenize", type=str)
16+
parser.add_argument("-pos-c", "--postag_corpus", default="orchid", help="corpus for postag", type=str)
1317
args = parser.parse_args()
18+
1419
if args.corpus:
1520
from pythainlp.corpus import *
1621
print("PyThaiNLP Corpus")
1722
temp=""
1823
while temp!="exit":
19-
print("\n\nPlease fill this out.\n1. install\n2. remove\n3. update\n4. exit\nex 1 or 2")
20-
temp=input("input (1,2,3 or 4) : ")
24+
print("\n1. Install\n2. Remove\n3. Update\n4. Exit\n")
25+
temp=input("Choose 1, 2, 3, or 4: ")
2126
if temp=="1":
22-
name=input("name corpus : ")
27+
name=input("Corpus name:")
2328
download(name)
2429
elif temp=="2":
25-
name=input("name corpus : ")
30+
name=input("Corpus name:")
2631
remove(name)
2732
elif temp=="3":
28-
name=input("name corpus : ")
33+
name=input("Corpus name:")
2934
download(name)
3035
elif temp=="4":
3136
break
3237
else:
33-
print("Please input 1,2,3 or 4.")
38+
print("Choose 1, 2, 3, or 4:")
3439
elif args.text!=None:
3540
from pythainlp.tokenize import word_tokenize
36-
tokens=word_tokenize(args.text,engine=args.engine)
41+
tokens=word_tokenize(args.text, engine=args.engine)
3742
if args.segment:
38-
print('|'.join(tokens))
43+
print("|".join(tokens))
3944
elif args.postag:
4045
from pythainlp.tag import pos_tag
4146
print("\t".join([i[0]+"/"+i[1] for i in pos_tag(tokens, engine=args.postag_engine, corpus=args.postag_corpus)]))
@@ -45,4 +50,4 @@ elif args.soundex!=None:
4550
args.engine="lk82"
4651
print(soundex(args.soundex, engine=args.engine))
4752
else:
48-
print("PyThaiNLP 2.0.2")
53+
print(f"PyThaiNLP {_VERSION}")

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 = "2.0.2" %}
1+
{% set version = "2.0.3" %}
22

33
package:
44
name: pythainlp

docs/api/tokenize.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Modules
1414
.. autofunction:: sent_tokenize
1515
.. autofunction:: dict_trie
1616
.. autoclass:: Tokenizer
17-
:members: word_tokenize,set_tokenize_engine
17+
:members: word_tokenize, set_tokenize_engine

meta.yaml

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

33
package:
44
name: pythainlp

0 commit comments

Comments
 (0)