syllabize 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ module Syllabize
6
6
  attr_accessor :word, :exceptions_file
7
7
 
8
8
  def initialize(word)
9
- @word = strip_apostrophes(word)
9
+ @word = strip_punctuation(word)
10
10
  handle_non_string_input
11
11
  load_exceptions
12
12
  end
@@ -33,8 +33,8 @@ module Syllabize
33
33
  File.dirname(__FILE__)
34
34
  end unless respond_to?(:__dir__, true)
35
35
 
36
- def strip_apostrophes(string)
37
- string.gsub("'",'')
36
+ def strip_punctuation(string)
37
+ string.gsub(/\W/,'')
38
38
  end
39
39
 
40
40
  def handle_non_string_input
@@ -1,3 +1,3 @@
1
1
  module Syllabize
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -114,7 +114,8 @@ describe Syllabize::Counter do
114
114
  'cooperate' => 4,
115
115
  'ways' => 1,
116
116
  "Wayne's" => 1,
117
- 'basement' => 2
117
+ 'basement' => 2,
118
+ 'basement,' => 2
118
119
  }.each do |word, actual|
119
120
  count = Syllabize::Counter.new(word).count_syllables
120
121
  expect(count).to eq(actual), "#{word} was not the correct number of syllables; expected #{actual}, was #{count}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syllabize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-26 00:00:00.000000000 Z
12
+ date: 2014-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler