Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

veer66/thailang4r

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thailang4r

Thai language utility for Ruby

I 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.
  • string_chlevel gives array of level back for example string_chlevel("กี") will return [1, 2]

Word breaker

# 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.

# encoding: UTF-8
require 'thailang4r/roman'
royin = ThaiLang::Royin.new
p royin.romanize("ฉันกินข้าว", "-")
# => "chan-kin-khao"

About

Thai language utility for Ruby

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages