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 +4 -4
- data/CHANGELOG +4 -0
- data/README.md +1 -0
- data/VERSION +1 -1
- data/lib/stopwords/snowball/locales/zh.csv +1 -0
- data/lib/stopwords/snowball/wordsieve.rb +9 -9
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 558571708b592d1e62ad33001d020e5ff5b92175
|
4
|
+
data.tar.gz: 3a503dfd7e0a56ee8563899f23b49df827538675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40fb7adfbc7debddc054e1555b21b243e121dda522749cf166520a4c06f2b8fa23776cef9b3dc69701f0f8bb29464c2d319816e7a57d6e69ac669c64b7ebc02c
|
7
|
+
data.tar.gz: 11153eebc434e912e271b2f57436ad1927e80aa381b7352356847965bb82e08b9ac5dd846d1a283ef47da3722774bcb39c8dafa2470d562dcea93f0735066ecb
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.7.0
|
@@ -0,0 +1 @@
|
|
1
|
+
的,地,得,和,跟,与,及,向,并,等,更,已,含,做,我,你,他,她,们,某,该,各,每,这,那,哪,什,么,谁,年,月,日,时,分,秒,几,多,来,在,就,又,很,呢,吧,吗,了,嘛,哇,儿,哼,啊,嗯,是,着,都,不,说,也,看,把,还,个,有,小,到,一,为,中,于,对,会,之,第,此,或,共,按,请
|
@@ -1,19 +1,19 @@
|
|
1
1
|
module Stopwords
|
2
2
|
module Snowball
|
3
|
-
class
|
4
|
-
def initialize
|
5
|
-
@filters = Dir[File.dirname(__FILE__)
|
6
|
-
lang = File.basename(file, '.csv')
|
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?
|
12
|
-
args[:lang] ? @filters[args[:lang]].stopword?(args[:word]
|
11
|
+
def stopword?(args = {})
|
12
|
+
args[:lang] ? @filters[args[:lang]].stopword?(args[:word]) : false
|
13
13
|
end
|
14
14
|
|
15
|
-
def filter
|
16
|
-
args[:lang] ? @filters[args[:lang]].filter(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.
|
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-
|
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
|