Simple Thai Wordcut in Python using Maximum Matching
Project description
# pythaiwordcut - Thai Wordcut in Python
A simple Thai wordcut written in Python, based on Maximum Matching algorithm by [S. Manabu](http://www.aclweb.org/anthology/E14-4016)
. Uses Lexitron (by [NECTEC](http://www.sansarn.com/lexto/license-lexitron.php)) dictionary as default
> Please note: This project is under development and should not be use in production , all function and interface are subject to change. If you have issue or suggestion please feel free to ask, contribution is also very welcome :)
## Installation
```
pip install pythaiwordcut
```
or
```
git clone https://github.com/zenyai/pythaiwordcut.git
python setup.py install
```
## Usage
```
import pythaiwordcut as pwt
pt = pwt.wordcut(removeRepeat=True, stopDictionary="<full path to txt file>", removeSpaces=True, minLength=1, stopNumber=False, removeNonCharacter=False, caseSensitive=True)
print "|".join(pt.segment(u'ทดสอบการตัดคำ'))
```
* removeRepeat: remove intention insertion spelling error such as (สบายยยยยย)
* stopDictionary: remove word that exist in this specify text file (one word one line)
* removeSpaces: remove blank space
* minLength: minimum length of each word
* stopNumber: remove number if exist
* removeNonCharacter: remove character that are not Thai or English character
* caseSensitive: if set to false, will remove stop word without regarding the case
A simple Thai wordcut written in Python, based on Maximum Matching algorithm by [S. Manabu](http://www.aclweb.org/anthology/E14-4016)
. Uses Lexitron (by [NECTEC](http://www.sansarn.com/lexto/license-lexitron.php)) dictionary as default
> Please note: This project is under development and should not be use in production , all function and interface are subject to change. If you have issue or suggestion please feel free to ask, contribution is also very welcome :)
## Installation
```
pip install pythaiwordcut
```
or
```
git clone https://github.com/zenyai/pythaiwordcut.git
python setup.py install
```
## Usage
```
import pythaiwordcut as pwt
pt = pwt.wordcut(removeRepeat=True, stopDictionary="<full path to txt file>", removeSpaces=True, minLength=1, stopNumber=False, removeNonCharacter=False, caseSensitive=True)
print "|".join(pt.segment(u'ทดสอบการตัดคำ'))
```
* removeRepeat: remove intention insertion spelling error such as (สบายยยยยย)
* stopDictionary: remove word that exist in this specify text file (one word one line)
* removeSpaces: remove blank space
* minLength: minimum length of each word
* stopNumber: remove number if exist
* removeNonCharacter: remove character that are not Thai or English character
* caseSensitive: if set to false, will remove stop word without regarding the case
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
pythaiwordcut-0.1.7.tar.gz
(218.4 kB
view details)
File details
Details for the file pythaiwordcut-0.1.7.tar.gz
.
File metadata
- Download URL: pythaiwordcut-0.1.7.tar.gz
- Upload date:
- Size: 218.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80ff54fbc3bcca3d7f9a4afff47c2b04e5edefccf756e41d8633f5889a2b3487 |
|
MD5 | ba5141818b8419bb35f4f2e68cf9393c |
|
BLAKE2b-256 | 1a2b8294a8f0b35f20624131334864260a6d323eeb6a88eb410e583eba956594 |