thailang4r 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/thailang4r/word_breaker.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad32c190796f76e0b32abacef6d7adaeb80507d3074229603efcfc3f23fa3301
|
|
4
|
+
data.tar.gz: 44dfa5295b4bf012bee39518530559d86de608c110a771940b86eee0c143a236
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 07ade35f315d1dd259f26e43b35629dd0727a482f89abcf33eb5894ab9102206e6754d7aa803496566b6a7952cdb63889ffcc739163892801d67ee7b83ee870b
|
|
7
|
+
data.tar.gz: 6443bdb2b1bdf46d93926fa95710dad7d5f68f364f873e114e0ffb9c3b58bc36014b32580a9d8b51332930fd13690739bfd9b4b5c22d64e4270c3321540260c5
|
data/README.md
CHANGED
|
@@ -35,6 +35,6 @@ A port of royin.py transliteration from [PyThaiNLP](https://pythainlp.github.io/
|
|
|
35
35
|
# encoding: UTF-8
|
|
36
36
|
require 'thailang4r/roman'
|
|
37
37
|
royin = ThaiLang::Royin.new
|
|
38
|
-
p .romanize("ฉันกินข้าว", "-")
|
|
38
|
+
p royin.romanize("ฉันกินข้าว", "-")
|
|
39
39
|
# => "chan-kin-khao"
|
|
40
40
|
```
|
|
@@ -38,10 +38,11 @@ module ThaiLang
|
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
|
|
43
43
|
class WordBreaker
|
|
44
|
-
def initialize(dix_path =
|
|
44
|
+
def initialize(dix_path = nil)
|
|
45
|
+
dix_path = File.expand_path('../../../data/tdict-std.txt', __FILE__) unless dix_path
|
|
45
46
|
@dix = PrefixTree.new(File.open(dix_path).each_line.map { [_1.chomp, 1] })
|
|
46
47
|
end
|
|
47
48
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: thailang4r
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vee Satayamas
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-04-
|
|
11
|
+
date: 2021-04-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Thai language tools for Ruby, i.e. a word tokenizer, a character level
|
|
14
14
|
indentifier, and a romanization tool
|