Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/veer66/thailang4r
Thai language utility for Ruby
https://github.com/veer66/thailang4r
Last synced: 6 days ago
JSON representation
Thai language utility for Ruby
- Host: GitHub
- URL: https://github.com/veer66/thailang4r
- Owner: veer66
- License: apache-2.0
- Archived: true
- Created: 2013-02-12T08:19:56.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2022-07-15T08:31:27.000Z (over 2 years ago)
- Last Synced: 2024-05-02T00:14:53.757Z (7 months ago)
- Language: Ruby
- Size: 83 KB
- Stars: 25
- Watchers: 6
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
thailang4r
==========
Thai language utility for RubyI have built this project in order to collect and share tools for Thai language, which are written in Ruby language.
Installation
------------> gem install thailang4r
Character level
---------------* chlevel is similar th_chlevel in [libthai](http://linux.thai.net/projects/libthai).
* string_chlevel gives array of level back for example string_chlevel("กี") will return [1, 2]Word breaker
------------```ruby
# encoding: UTF-8
require 'thailang4r/word_breaker'
word_breaker = ThaiLang::WordBreaker.new
puts word_breaker.break_into_words("ฉันกินข้าว")
# ["ฉัน", "กิน", "ข้าว"]
```Romanization
------------A port of royin.py transliteration from [PyThaiNLP](https://pythainlp.github.io/).
```ruby
# encoding: UTF-8
require 'thailang4r/roman'
royin = ThaiLang::Royin.new
p royin.romanize("ฉันกินข้าว", "-")
# => "chan-kin-khao"
```