phonetics 3.0.6 → 3.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -183,20 +183,20 @@ module Phonetics
183
183
 
184
184
  # Given two consonants, calculate their difference by summing the
185
185
  # following:
186
- # * 0.1 if they are not voiced the same
186
+ # * 0.3 if they are not voiced the same
187
187
  # * 0.3 if they are different manners
188
- # * Up to 0.6 if they are the maximum position difference
188
+ # * Up to 0.4 if they are the maximum position difference
189
189
  def distance(phoneme1, phoneme2)
190
190
  features1 = features[phoneme1]
191
191
  features2 = features[phoneme2]
192
192
 
193
193
  penalty = 0
194
- penalty += 0.1 if features1[:voiced] != features2[:voiced]
194
+ penalty += 0.3 if features1[:voiced] != features2[:voiced]
195
195
 
196
196
  penalty += 0.3 if features1[:manner] != features2[:manner]
197
197
 
198
- # Use up to the remaining 0.6 for penalizing differences in manner
199
- penalty += 0.6 * ((features1[:position_index] - features2[:position_index]).abs / @position_count.to_f)
198
+ # Use up to the remaining 0.4 for penalizing differences in manner
199
+ penalty += 0.4 * ((features1[:position_index] - features2[:position_index]).abs / @position_count.to_f)
200
200
  penalty
201
201
  end
202
202
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phonetics
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.6
4
+ version: 3.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Danger