Standalone Dictionary-based, Maximum Matching + Thai Character Cluster (newmm) tokenizer extracted from PyThaiNLP
Project description
newmm-tokenizer
Standalone Dictionary-based, Maximum Matching + Thai Character Cluster (newmm) tokenizer extracted from PyThaiNLP.
Objectives
This repository is created for reducing an overall size of original PyThaiNLP Tokenizer Module. The main objective is to be able to segment Thai sentences into a list of words.
Supports
The module supports Python 3.7+ as follow the original PyThaiNLP repository.
Installation
pip install newmm-tokenizer
How to Use
from newmm_tokenizer.tokenizer import word_tokenize
text = 'เป็นเรื่องแรกที่ร้องไห้ตั้งแต่ ep 1 แล้วก็เป็นเรื่องแรกที่เลือกไม่ได้ว่าจะเชียร์พระเอกหรือพระรองดี 19...'
words = word_tokenize(text)
print(words)
# ['เป็นเรื่อง', 'แรก', 'ที่', 'ร้องไห้', 'ตั้งแต่', ' ', 'ep', ' ', '1', ' ', 'แล้วก็', 'เป็นเรื่อง', 'แรก', 'ที่', 'เลือกไม่ได้', 'ว่า', 'จะ', 'เชียร์', 'พระเอก', 'หรือ', 'พระรอง', 'ดี', ' ', '19', '...']
LICENSE
Please see the original license of PyThaiNLP here
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
newmm_tokenizer-0.2.2.tar.gz
(314.2 kB
view hashes)
Built Distribution
Close
Hashes for newmm_tokenizer-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ef54c67585d0f562650c93368a07ba0e39b5c8dc4500991135c57df58da65a5 |
|
MD5 | 82817a057f1e38346cfa1290f6514eb8 |
|
BLAKE2b-256 | 96f2e93d15afba1dec377d3a4c018ec1f75214510d6a1792ea9ecee526f5089d |