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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1af7a4c89e108e784964062d2381ae2b2b81715eb5c0f2da4e6c5aa9604426b
4
- data.tar.gz: 85aaded96eea07d8369007f76adac54abff69fc246ae798da78da1d6ffa51887
3
+ metadata.gz: ad32c190796f76e0b32abacef6d7adaeb80507d3074229603efcfc3f23fa3301
4
+ data.tar.gz: 44dfa5295b4bf012bee39518530559d86de608c110a771940b86eee0c143a236
5
5
  SHA512:
6
- metadata.gz: fc738de378f475f7eafa0439176293cd0b524cc3dd8cc246421bb7dc3b444b57f9e12ebdcfffebd56ce3cbdeb3226f72b4909674ae5438b942b040304c600799
7
- data.tar.gz: 53aab1f982c0aeadc812e2e2618a1651f1e620dd745d54c2b42195bc3ffd8c60152f3f8fe6be08d73fb95f95bd7f3dff10edc0e91c50a5e2bc12bc3d3589473b
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
- DEFAULT_THAI_DICT_PATH = File.expand_path('../../../data/tdict-std.txt', __FILE__)
41
+
42
42
 
43
43
  class WordBreaker
44
- def initialize(dix_path = DEFAULT_THAI_DICT_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.2
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-26 00:00:00.000000000 Z
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