wordcuta 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wordcuta.rb +12 -5
- data/wordcuta.gemspec +4 -5
- metadata +11 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4496824d87c7eb49d72ecc7442dcbfa3a1485dbeff9b70579f1717b016bf006f
|
4
|
+
data.tar.gz: 32ae3e5760f83eb64ef3a89235c2f0e41812bb7d63d97fe30a8818b5007f39d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
30
|
-
|
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.
|
3
|
+
s.version = '0.3.0'
|
4
4
|
s.authors = ['Vee Satayamas']
|
5
|
-
s.email = ['
|
5
|
+
s.email = ['vsatayamas@gmail.com']
|
6
6
|
s.licenses = ['LGPL-3.0']
|
7
|
-
s.description = "A word segmentation tools for ASEAN languages
|
8
|
-
s.homepage = "https://
|
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.add_dependency 'ffi', '1.15.5'
|
13
12
|
end
|
metadata
CHANGED
@@ -1,32 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wordcuta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 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:
|
12
|
-
dependencies:
|
13
|
-
-
|
14
|
-
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.15.5
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - '='
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 1.15.5
|
27
|
-
description: A word segmentation tools for ASEAN languages wrapper for Ruby
|
11
|
+
date: 2023-12-19 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A Ruby wrapper of wordcut-engine - a word segmentation tools for ASEAN
|
14
|
+
languages, i.e. Khmer, Lao, Myanmar, and Thai
|
28
15
|
email:
|
29
|
-
-
|
16
|
+
- vsatayamas@gmail.com
|
30
17
|
executables: []
|
31
18
|
extensions: []
|
32
19
|
extra_rdoc_files: []
|
@@ -37,11 +24,11 @@ files:
|
|
37
24
|
- data/thai-dix.txt
|
38
25
|
- lib/wordcuta.rb
|
39
26
|
- wordcuta.gemspec
|
40
|
-
homepage: https://
|
27
|
+
homepage: https://codeberg.org/mekong/wordcuta
|
41
28
|
licenses:
|
42
29
|
- LGPL-3.0
|
43
30
|
metadata: {}
|
44
|
-
post_install_message:
|
31
|
+
post_install_message:
|
45
32
|
rdoc_options: []
|
46
33
|
require_paths:
|
47
34
|
- lib
|
@@ -56,8 +43,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
43
|
- !ruby/object:Gem::Version
|
57
44
|
version: '0'
|
58
45
|
requirements: []
|
59
|
-
rubygems_version: 3.
|
60
|
-
signing_key:
|
46
|
+
rubygems_version: 3.4.10
|
47
|
+
signing_key:
|
61
48
|
specification_version: 4
|
62
49
|
summary: A word segmentation tools for ASEAN languages wrapper for Ruby
|
63
50
|
test_files: []
|