Skip to main content

pythaiwordcut - Thai Wordcut in Python

Codacy Badge PyPI - Downloads PyPI - License PyPI - Python Version


A simple Thai wordcut written in Python, based on Maximum Matching algorithm by S. Manabu . Uses Lexitron (by NECTEC) 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, ngram=(1, 2), negation=False)
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
  • ngram: Add word ngram from (1, 2)
  • negation: If set to true, then it will add NOT_ to every word after negation word and space

Release files for pythaiwordcut 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pythaiwordcut 0.2.0
File Size Uploaded
pythaiwordcut-0.2.0.tar.gz 219.6 kB Details

Release files / pythaiwordcut-0.2.0.tar.gz

Download URL pythaiwordcut-0.2.0.tar.gz
Size 219.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7aba80dc5a415305fecb8ff1dd2ce4769b94474851811e7b045760874bf69b14
BLAKE2b-256 checksum
How to use checksums
6877a4378cd235bd7ae0350d888b4baf855c6e1a094474c5a7d62f060587a92a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file

0.1.15

2 release files

0.1.14

1 release file

0.1.13

1 release file

0.1.12

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page