wordcuta 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/wordcuta.rb +12 -5
  3. data/wordcuta.gemspec +4 -5
  4. metadata +11 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f77edbb75622406c64839dff1ed7c45c5f0d07ac9775f268d9ab36dba0b163c
4
- data.tar.gz: 16c7697a501a4aaa044dde4a0c2626e176192fac42a65c8fcfe29eaacd2b9236
3
+ metadata.gz: 4496824d87c7eb49d72ecc7442dcbfa3a1485dbeff9b70579f1717b016bf006f
4
+ data.tar.gz: 32ae3e5760f83eb64ef3a89235c2f0e41812bb7d63d97fe30a8818b5007f39d3
5
5
  SHA512:
6
- metadata.gz: d1f63dcb36276a0e2118cde0aae5a07c44fc73a78937f787d0802d7ba68977dfcee3549ac7c6ab3c6470ced53aa44a4e19857abaeeeb7cf60fcf80f84430b698
7
- data.tar.gz: 66dc0d88cf17cef24a2ff66140fe1e7b0e6f043f75513be0fb3097103a5cf38beba55e0eaa13d4472cab8d9756a42f3be4d29fefffc40184ef4dade8e9c0fca7
6
+ metadata.gz: 0b4d8503f9a59b61cbd156c97c8b1461d9d3ba732aab2f585ff542932c9868f0d07cd6169ab7bd85cfca33271acb7a1ed88cd3de50cf6fbfac9f6fd8afa1a82c
7
+ data.tar.gz: '08467876b7ade9e6e49c1b06482f8564470b541e94435f8fab6558d5ef0b4e6a4a3dfab4652896ac5efae67b28500d7e93905884f2f2cccdbafd61cd45e2cc72'
data/lib/wordcuta.rb CHANGED
@@ -10,8 +10,9 @@ module WordcutFFI
10
10
  extend FFI::Library
11
11
 
12
12
  ffi_lib "wordcutw"
13
-
13
+
14
14
  attach_function :wordcut_new_with_dict, [:string], :pointer
15
+ attach_function :wordcut_new_with_dict_and_cluster_rules, [:string, :string], :pointer
15
16
  attach_function :wordcut_into_text_ranges, [:pointer, :string, :pointer], :pointer
16
17
  attach_function :wordcut_into_strings, [:pointer, :string, :pointer], :pointer
17
18
  attach_function :wordcut_put_delimiters, [:pointer, :string, :string], :string
@@ -23,11 +24,17 @@ module WordcutA
23
24
  TextRange = Struct.new(:s, :e)
24
25
 
25
26
  DEFAULT_THAI_DICT_PATH = File.expand_path('../../data/thai-dix.txt', __FILE__)
26
-
27
+
27
28
  class Wordcut
28
- def initialize(dict_path)
29
- @wordcut_p = FFI::AutoPointer.new(WordcutFFI.wordcut_new_with_dict(dict_path),
30
- WordcutFFI.method(:delete_wordcut))
29
+ def initialize(dict_path, cluster_rule_path = nil)
30
+ if cluster_rule_path
31
+ @wordcut_p = FFI::AutoPointer.new(
32
+ WordcutFFI.wordcut_new_with_dict_and_cluster_rules(dict_path, cluster_rule_path),
33
+ WordcutFFI.method(:delete_wordcut))
34
+ else
35
+ @wordcut_p = FFI::AutoPointer.new(WordcutFFI.wordcut_new_with_dict(dict_path),
36
+ WordcutFFI.method(:delete_wordcut))
37
+ end
31
38
  end
32
39
 
33
40
  def into_ranges(text)
data/wordcuta.gemspec CHANGED
@@ -1,13 +1,12 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'wordcuta'
3
- s.version = '0.2.0'
3
+ s.version = '0.3.0'
4
4
  s.authors = ['Vee Satayamas']
5
- s.email = ['5ssgdxltv@relay.firefox.com']
5
+ s.email = ['vsatayamas@gmail.com']
6
6
  s.licenses = ['LGPL-3.0']
7
- s.description = "A word segmentation tools for ASEAN languages wrapper for Ruby"
8
- s.homepage = "https://github.com/veer66/wordcuta"
7
+ s.description = "A Ruby wrapper of wordcut-engine - a word segmentation tools for ASEAN languages, i.e. Khmer, Lao, Myanmar, and Thai"
8
+ s.homepage = "https://codeberg.org/mekong/wordcuta"
9
9
  s.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
10
10
  s.summary = "A word segmentation tools for ASEAN languages wrapper for Ruby"
11
11
  s.files = %w(README.md LICENSE Gemfile wordcuta.gemspec data/thai-dix.txt lib/wordcuta.rb)
12
- s.requirements << 'ffi, v1.15.5'
13
12
  end
metadata CHANGED
@@ -1,18 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordcuta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vee Satayamas
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-16 00:00:00.000000000 Z
11
+ date: 2023-12-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: A word segmentation tools for ASEAN languages wrapper for Ruby
13
+ description: A Ruby wrapper of wordcut-engine - a word segmentation tools for ASEAN
14
+ languages, i.e. Khmer, Lao, Myanmar, and Thai
14
15
  email:
15
- - 5ssgdxltv@relay.firefox.com
16
+ - vsatayamas@gmail.com
16
17
  executables: []
17
18
  extensions: []
18
19
  extra_rdoc_files: []
@@ -23,11 +24,11 @@ files:
23
24
  - data/thai-dix.txt
24
25
  - lib/wordcuta.rb
25
26
  - wordcuta.gemspec
26
- homepage: https://github.com/veer66/wordcuta
27
+ homepage: https://codeberg.org/mekong/wordcuta
27
28
  licenses:
28
29
  - LGPL-3.0
29
30
  metadata: {}
30
- post_install_message:
31
+ post_install_message:
31
32
  rdoc_options: []
32
33
  require_paths:
33
34
  - lib
@@ -41,10 +42,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
41
42
  - - ">="
42
43
  - !ruby/object:Gem::Version
43
44
  version: '0'
44
- requirements:
45
- - ffi, v1.15.5
46
- rubygems_version: 3.2.22
47
- signing_key:
45
+ requirements: []
46
+ rubygems_version: 3.4.10
47
+ signing_key:
48
48
  specification_version: 4
49
49
  summary: A word segmentation tools for ASEAN languages wrapper for Ruby
50
50
  test_files: []