Code Monkey home page Code Monkey logo

pythai's Introduction

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 of split)
  • 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 pythai==0.1.3

More

Special thanks to Vee Satayamas for the original python bindings of libthai from C.

This library was written for use in Gengo. It's free and open-source under the GNU lesser public license. Any contributions are welcome!

pythai's People

Contributors

hermanschaaf avatar shawnps avatar wannaphong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.