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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58565ee983a2150f10fc30a134866966f258035f
4
- data.tar.gz: e64ca90da702b11ae24be30968b036b550be4d3a
3
+ metadata.gz: d26cc44221f2412fcd48d2463a2f306a6d8a5ea7
4
+ data.tar.gz: 333525a5ca5934d42b2c69cb3c7901be9b8fc765
5
5
  SHA512:
6
- metadata.gz: 51cf55d7abfaf2610c86a9d73f1f3a305770e7bf28aa6d6235836dd5789c36b91e534d9fddcb5506dc1b4b45b80765724a6b751d05ba836243edf2dd7dc58b81
7
- data.tar.gz: 1cbd8554f5703f4bc593a718f0e691cff000282a5652c518e7ceb07a491a740a6cb20ddec493fa61a63cff8f69247837625499192f9e10ad1ef81fd4ef89ce4d
6
+ metadata.gz: 58533ded8c5c7bd74310a6db0eed6f082136288bd19d1e2627010df201057435344495526cc8683fee45e9f7ad206ca2f3bea6a74337a9561e46e781f967384d
7
+ data.tar.gz: 41ded05e9f3e2b4fba1fb628946e2154ae98e719e125df36e5dff22475b73a9aeadff54f9d0212c33eda574451129079ec8ad4c6c3f359c564ec421cb17e0450
@@ -1,3 +1,6 @@
1
+ # 0.0.3 / 2014-04-07
2
+ * [BUGFIX] Simplified regex
3
+
1
4
  # 0.0.2 / 2014-03-12
2
5
  * [FEATURE] Added n-gram generator
3
6
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clarifier (0.0.2)
4
+ clarifier (0.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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.sub!(/^#{word}\s/i, '') #beginning
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
- #new_string.gsub!(/\s+/, ' ')
29
+ new_string.gsub!(/\s+/, ' ')
30
+ new_string.strip!
35
31
 
36
32
  new_string
37
33
  end
@@ -1,3 +1,3 @@
1
1
  module Clarifier
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
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-03-12 00:00:00.000000000 Z
11
+ date: 2014-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler