Python - libthai binding library.
Project description
PyThai
Some basic python functions for working with the Thai language. For example:
import pythai
pythai.split(u"การที่ได้ต้องแสดงว่างานดี")
>>> u"การ ที่ ได้ ต้อง แสดง ว่า งาน ดี"
pythai.word_count(u"การที่ได้ต้องแสดงว่างานดี")
>>> 8
pythai.contains_thai(u"hello")
>>> False
pythai.contains_thai(u"helloการที่ไ")
>>> True
It's meant to be fast and efficient enough to handle large documents without breaking a sweat.
Includes
Currently the library supports these functions:
- Word segmentation (
split) - Word count (
word_count) (faster than counting the result ofsplit) - Whether a string contains Thai or not (
contains_thai)
Installation
PyThai requires libthai-dev to work. You can install it quite easily:
sudo apt-get install libthai-dev
And then you can simply install pythai through pip:
pip install python-libthai
More
Special thanks to Vee Satayamas for the original python bindings of libthai from C.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-libthai-0.1.4.tar.gz
(13.6 kB
view details)
File details
Details for the file python-libthai-0.1.4.tar.gz.
File metadata
- Download URL: python-libthai-0.1.4.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bbe53eef6fd4341be3cdf3d0696c9f2175981a87dd3cf53b84e4a88757f114b
|
|
| MD5 |
07d8f8a2d3c3bc087ce94ec13cbde271
|
|
| BLAKE2b-256 |
96566a1738ad6efc0753bf040dc3f4a09ac0f37f6841e348aeae5c51c7e2e69d
|