clarifier 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/clarifier/stop_words.rb +3 -7
- data/lib/clarifier/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d26cc44221f2412fcd48d2463a2f306a6d8a5ea7
|
4
|
+
data.tar.gz: 333525a5ca5934d42b2c69cb3c7901be9b8fc765
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58533ded8c5c7bd74310a6db0eed6f082136288bd19d1e2627010df201057435344495526cc8683fee45e9f7ad206ca2f3bea6a74337a9561e46e781f967384d
|
7
|
+
data.tar.gz: 41ded05e9f3e2b4fba1fb628946e2154ae98e719e125df36e5dff22475b73a9aeadff54f9d0212c33eda574451129079ec8ad4c6c3f359c564ec421cb17e0450
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/clarifier/stop_words.rb
CHANGED
@@ -21,17 +21,13 @@ module Clarifier
|
|
21
21
|
|
22
22
|
def clarify(input)
|
23
23
|
new_string = input.dup
|
24
|
-
#new_string.downcase!
|
25
|
-
#new_string.gsub!(/[[:punct:]]/, ' ')
|
26
|
-
#new_string.gsub!(/\s+/, ' ')
|
27
24
|
|
28
25
|
@stopwords.each do |word|
|
29
|
-
new_string.
|
30
|
-
new_string.gsub!(/\s#{word}\s/i, ' ') #middle
|
31
|
-
new_string.sub!(/\s#{word}$/i, '') #end
|
26
|
+
new_string.gsub!(/(^|\s)#{word}(\s|$)/i, '\1\2')
|
32
27
|
end
|
33
28
|
|
34
|
-
|
29
|
+
new_string.gsub!(/\s+/, ' ')
|
30
|
+
new_string.strip!
|
35
31
|
|
36
32
|
new_string
|
37
33
|
end
|
data/lib/clarifier/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clarifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Styles
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|