stopwords-filter 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f43db8de625992e54e752f11c4dec0b867356110
4
- data.tar.gz: 65ce58a27b428dd485233162d136b875e14a67d9
3
+ metadata.gz: 558571708b592d1e62ad33001d020e5ff5b92175
4
+ data.tar.gz: 3a503dfd7e0a56ee8563899f23b49df827538675
5
5
  SHA512:
6
- metadata.gz: b1fc4531396521496d8a2e27da5e3a8b695194da9def0028db4bf01421aa9a705c50ababa0ee4428f8fcec8ababcdb053cdd9654a5c8cdf7d1a4c5cce531446d
7
- data.tar.gz: acc0042a007890fee128b965b0291d8b9bf3feb3cd1f2808bb19db9fe2f38ce7f5dfbb3a5d111d4b84a37c6174bc38dc2b9cb11200dee141d2b435b7f7b28315
6
+ metadata.gz: 40fb7adfbc7debddc054e1555b21b243e121dda522749cf166520a4c06f2b8fa23776cef9b3dc69701f0f8bb29464c2d319816e7a57d6e69ac669c64b7ebc02c
7
+ data.tar.gz: 11153eebc434e912e271b2f57436ad1927e80aa381b7352356847965bb82e08b9ac5dd846d1a283ef47da3722774bcb39c8dafa2470d562dcea93f0735066ecb
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.7.0:
2
+ * Fixed Wordiseve class [@hmaack] [#19]
3
+ * Added suport for Chinese (zh) [@bettysteger] [#20]
4
+
1
5
  0.6.0:
2
6
  * Added support for: [@bettysteger] [#16]
3
7
  * Afrikaans (af)
data/README.md CHANGED
@@ -134,6 +134,7 @@ Currently we have support for:
134
134
  * Bengali (bn)
135
135
  * Breton (br)
136
136
  * Catalán (ca)
137
+ * Chinese (zh)
137
138
  * Czesch (cs)
138
139
  * Danish (da)
139
140
  * German (de)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.7.0
@@ -0,0 +1 @@
1
+ 的,地,得,和,跟,与,及,向,并,等,更,已,含,做,我,你,他,她,们,某,该,各,每,这,那,哪,什,么,谁,年,月,日,时,分,秒,几,多,来,在,就,又,很,呢,吧,吗,了,嘛,哇,儿,哼,啊,嗯,是,着,都,不,说,也,看,把,还,个,有,小,到,一,为,中,于,对,会,之,第,此,或,共,按,请
@@ -1,19 +1,19 @@
1
1
  module Stopwords
2
2
  module Snowball
3
- class Stopwords::Snowball::WordSieve
4
- def initialize custom_list = []
5
- @filters = Dir[File.dirname(__FILE__) + '/locales/*.csv'].each_with_object({}) do |file, filters|
6
- lang = File.basename(file, '.csv').to_sym
7
- filters[lang] = Stopwords::Snowball::Filter.new lang, custom_list
3
+ class WordSieve
4
+ def initialize(custom_list = [])
5
+ @filters = Dir["#{File.dirname(__FILE__)}/locales/*.csv"].each_with_object({}) do |file, filters|
6
+ lang = File.basename(file, '.csv')
7
+ filters[lang.to_sym] = Stopwords::Snowball::Filter.new lang, custom_list
8
8
  end
9
9
  end
10
10
 
11
- def stopword? args={}
12
- args[:lang] ? @filters[args[:lang]].stopword?(args[:word] ) : false
11
+ def stopword?(args = {})
12
+ args[:lang] ? @filters[args[:lang]].stopword?(args[:word]) : false
13
13
  end
14
14
 
15
- def filter args={}
16
- args[:lang] ? @filters[args[:lang]].filter(args[:words] ) : args[:words]
15
+ def filter(args = {})
16
+ args[:lang] ? @filters[args[:lang]].filter(args[:words]) : args[:words]
17
17
  end
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stopwords-filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David J. Brenes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-21 00:00:00.000000000 Z
11
+ date: 2021-12-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Small library that allows you to create a simple stopwords filter or
14
14
  use some based on Snowball stopwords lists
@@ -59,6 +59,7 @@ files:
59
59
  - lib/stopwords/snowball/locales/th.csv
60
60
  - lib/stopwords/snowball/locales/tr.csv
61
61
  - lib/stopwords/snowball/locales/vi.csv
62
+ - lib/stopwords/snowball/locales/zh.csv
62
63
  - lib/stopwords/snowball/wordsieve.rb
63
64
  - spec/lib/filter_spec.rb
64
65
  - spec/lib/snowball_filter_spec.rb