phonetics 1.5.1 → 1.5.2
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +47 -0
- data/.travis.yml +2 -1
- data/Gemfile +2 -2
- data/Rakefile +6 -1
- data/VERSION +1 -1
- data/ext/c_levenshtein/extconf.rb +3 -3
- data/lib/phonetics.rb +41 -37
- data/lib/phonetics/levenshtein.rb +5 -3
- data/lib/phonetics/ruby_levenshtein.rb +31 -28
- data/lib/phonetics/version.rb +2 -0
- data/phonetics.gemspec +19 -15
- metadata +26 -39
- data/Gemfile.lock +0 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 551a25deff1697f690f93a1b0df33eb6c47800d4b77ac313be9a27583439d32f
|
4
|
+
data.tar.gz: 142a54e76defe55e5fbef13df79bc1d308ed46fa8cbcb8da3d4d1dde3a78447d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa2d8c53d0536936b64e13ca6aae3ada7b75d327e399d2301424009264b53aeaacf961b1bdd39ab54af8e8f7087e2dd277b94d99f373f445e070999ba18535fa
|
7
|
+
data.tar.gz: 2b0c41e648878df94ff8b493e7484ecbee544cb430ebc0a87ea1a11323c8a546123c2d5b2e3f96211ccee2a04b7e19cdf20ab46abc5c7d6fe15ab6a13e9ed8aa
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
AllCops:
|
3
|
+
Exclude:
|
4
|
+
- Rakefile
|
5
|
+
|
6
|
+
Metrics/AbcSize:
|
7
|
+
Enabled: false
|
8
|
+
|
9
|
+
Metrics/ClassLength:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
Metrics/BlockLength:
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
Metrics/LineLength:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
Metrics/MethodLength:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
Naming/ConstantName:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
Naming/UncommunicativeMethodParamName:
|
25
|
+
Enabled: false
|
26
|
+
|
27
|
+
Style/Documentation:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
Style/AsciiComments:
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
Style/ModuleFunction:
|
34
|
+
EnforcedStyle: extend_self
|
35
|
+
|
36
|
+
Style/MultilineBlockChain:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
Style/NumericPredicate:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
Style/TrailingCommaInHashLiteral:
|
43
|
+
EnforcedStyleForMultiline: consistent_comma
|
44
|
+
|
45
|
+
Layout/AlignHash:
|
46
|
+
EnforcedHashRocketStyle: separator
|
47
|
+
EnforcedColonStyle: separator
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'bundler/gem_tasks'
|
2
4
|
require 'rake/extensiontask'
|
3
5
|
require 'rspec/core/rake_task'
|
6
|
+
require 'rubocop/rake_task'
|
4
7
|
|
5
8
|
Rake::ExtensionTask.new('c_levenshtein') do |extension|
|
6
9
|
extension.ext_dir = 'ext/c_levenshtein'
|
@@ -22,4 +25,6 @@ task compile: 'compile:phonetic_cost'
|
|
22
25
|
|
23
26
|
RSpec::Core::RakeTask.new(:spec)
|
24
27
|
|
25
|
-
|
28
|
+
RuboCop::RakeTask.new
|
29
|
+
|
30
|
+
task default: [:compile, :rubocop, :spec]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.2
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Loads mkmf which is used to make makefiles for Ruby extensions
|
4
|
-
require
|
4
|
+
require 'mkmf'
|
5
5
|
|
6
6
|
# The destination
|
7
|
-
dir_config(
|
7
|
+
dir_config('phonetics/levenshtein')
|
8
8
|
|
9
9
|
# Do the work
|
10
|
-
create_makefile(
|
10
|
+
create_makefile('phonetics/c_levenshtein')
|
data/lib/phonetics.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'delegate'
|
2
4
|
|
3
5
|
module Phonetics
|
@@ -10,7 +12,6 @@ module Phonetics
|
|
10
12
|
# Phonetics::String.new("wətɛvɝ").each_phoneme.to_a
|
11
13
|
# => ["w", "ə", "t", "ɛ", "v", "ɝ"]
|
12
14
|
class String < SimpleDelegator
|
13
|
-
|
14
15
|
# Group all phonemes by how many characters they have. Use this to walk
|
15
16
|
# through a string finding phonemes (looking for longest ones first)
|
16
17
|
def self.phonemes_by_length
|
@@ -29,16 +30,15 @@ module Phonetics
|
|
29
30
|
while idx < chars.length
|
30
31
|
found = false
|
31
32
|
self.class.phonemes_by_length.each do |size, phonemes|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
end
|
33
|
+
next unless idx + size <= chars.length
|
34
|
+
|
35
|
+
candidate = chars[idx..idx + size - 1].join
|
36
|
+
next unless phonemes.include?(candidate)
|
37
|
+
|
38
|
+
y.yield candidate
|
39
|
+
idx += size
|
40
|
+
found = true
|
41
|
+
break
|
42
42
|
end
|
43
43
|
idx += 1 unless found
|
44
44
|
end
|
@@ -76,7 +76,7 @@ module Phonetics
|
|
76
76
|
'u' => { F1: 350, F2: 650, rounded: true }, # Guessing From other vowels
|
77
77
|
'ʊ' => { F1: 350, F2: 650, rounded: true },
|
78
78
|
# Frequencies from http://videoweb.nie.edu.sg/phonetic/vowels/measurements.html
|
79
|
-
}
|
79
|
+
}.freeze
|
80
80
|
|
81
81
|
def phonemes
|
82
82
|
@phonemes ||= FormantFrequencies.keys
|
@@ -90,8 +90,8 @@ module Phonetics
|
|
90
90
|
formants1 = FormantFrequencies.fetch(phoneme1)
|
91
91
|
formants2 = FormantFrequencies.fetch(phoneme2)
|
92
92
|
|
93
|
-
@minmax_f1 ||= FormantFrequencies.values.minmax {|a, b| a[:F1] <=> b[:F1] }.map {|h| h[:F1] }
|
94
|
-
@minmax_f2 ||= FormantFrequencies.values.minmax {|a, b| a[:F2] <=> b[:F2] }.map {|h| h[:F2] }
|
93
|
+
@minmax_f1 ||= FormantFrequencies.values.minmax { |a, b| a[:F1] <=> b[:F1] }.map { |h| h[:F1] }
|
94
|
+
@minmax_f2 ||= FormantFrequencies.values.minmax { |a, b| a[:F2] <=> b[:F2] }.map { |h| h[:F2] }
|
95
95
|
|
96
96
|
# Get an x and y value for each input phoneme scaled between 0.0 and 1.0
|
97
97
|
# We'll use the scaled f1 as the 'x' and the scaled f2 as the 'y'
|
@@ -105,7 +105,7 @@ module Phonetics
|
|
105
105
|
|
106
106
|
# When we have four values we can use the pythagorean theorem on them
|
107
107
|
# (order doesn't matter)
|
108
|
-
Math.sqrt((f1_distance
|
108
|
+
Math.sqrt((f1_distance**2) + (f2_distance**2))
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
@@ -116,22 +116,24 @@ module Phonetics
|
|
116
116
|
# sibilant fricatives and non-sibilant fricatives
|
117
117
|
# TODO: this is unfinished and possibly a bad idea
|
118
118
|
MannerDistances = {
|
119
|
-
|
120
|
-
|
121
|
-
|
119
|
+
'Nasal' => %w[continuant],
|
120
|
+
'Stop' => %w[],
|
121
|
+
'Sibilant fricative' => %w[continuant fricative],
|
122
122
|
'Non-sibilant fricative' => %w[continuant non_sibilant fricative],
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
123
|
+
'Approximant' => %w[],
|
124
|
+
'Tap/Flap' => %w[],
|
125
|
+
'Trill' => %w[],
|
126
|
+
'Lateral fricative' => %w[continuant fricative],
|
127
|
+
'Lateral approximant' => %w[],
|
128
|
+
'Lateral tap/flap' => %w[],
|
129
129
|
}.freeze
|
130
130
|
|
131
131
|
# This chart (columns 2 through the end, anyway) is a direct port of
|
132
132
|
# https://en.wikipedia.org/wiki/International_Phonetic_Alphabet#Letters
|
133
|
-
# We
|
134
|
-
|
133
|
+
# We store the consonant table in this format to make updating it easier.
|
134
|
+
#
|
135
|
+
# rubocop:disable Layout/TrailingWhitespace
|
136
|
+
ChartData = %( | Labio-velar | Bi-labial | Labio-dental | Linguo-labial | Dental | Alveolar | Post-alveolar | Retro-flex | Palatal | Velar | Uvular | Pharyngeal | Glottal
|
135
137
|
Nasal | | m̥ m | ɱ | n̼ | | n̥ n | | ɳ̊ ɳ | ɲ̊ ɲ | ŋ̊ ŋ | ɴ | |
|
136
138
|
Stop | | p b | p̪ b̪ | t̼ d̼ | | t d | | ʈ ɖ | c ɟ | k g | q ɢ | ʡ | ʔ
|
137
139
|
Sibilant fricative | | | | | | s z | ʃ ʒ | ʂ ʐ | ɕ ʑ | | | |
|
@@ -142,12 +144,13 @@ module Phonetics
|
|
142
144
|
Lateral fricative | | | | | | ɬ ɮ | | ɭ̊˔ ɭ˔ | ʎ̝̊ ʎ̝ | ʟ̝̊ ʟ̝ | | |
|
143
145
|
Lateral approximant | | | | | | l̥ l | | ɭ̊ ɭ | ʎ̥ ʎ | ʟ̥ ʟ | ʟ̠ | |
|
144
146
|
Lateral tap/flap | | | | | | ɺ | | ɭ̆ | ʎ̆ | ʟ̆ | | |
|
145
|
-
|
147
|
+
)
|
148
|
+
# rubocop:enable Layout/TrailingWhitespace
|
146
149
|
|
147
150
|
# Parse the ChartData into a lookup table where we can retrieve attributes
|
148
151
|
# for each phoneme
|
149
152
|
def features
|
150
|
-
@features ||= begin
|
153
|
+
@features ||= begin
|
151
154
|
header, *manners = ChartData.lines
|
152
155
|
|
153
156
|
_, *positions = header.chomp.split(' | ')
|
@@ -165,9 +168,9 @@ module Phonetics
|
|
165
168
|
manner.strip!
|
166
169
|
positions.zip(columns).each do |position, phoneme_text|
|
167
170
|
data = {
|
168
|
-
|
171
|
+
position: position,
|
169
172
|
position_index: position_indexes[position],
|
170
|
-
|
173
|
+
manner: manner,
|
171
174
|
}
|
172
175
|
# If there is a character in the first byte then this articulation
|
173
176
|
# has a voiceless phoneme. The symbol may use additional characters
|
@@ -218,19 +221,20 @@ module Phonetics
|
|
218
221
|
Consonants.phonemes + Vowels.phonemes
|
219
222
|
end
|
220
223
|
|
221
|
-
Symbols = Consonants.phonemes.reduce({}) {|acc, p| acc.update p => :consonant }.merge(
|
224
|
+
Symbols = Consonants.phonemes.reduce({}) { |acc, p| acc.update p => :consonant }.merge(
|
222
225
|
Vowels.phonemes.reduce({}) { |acc, p| acc.update p => :vowel }
|
223
226
|
)
|
224
227
|
|
225
228
|
def distance(phoneme1, phoneme2)
|
226
229
|
return 0 if phoneme1 == phoneme2
|
230
|
+
|
227
231
|
distance_map.fetch(phoneme1).fetch(phoneme2)
|
228
232
|
end
|
229
233
|
|
230
234
|
def distance_map
|
231
235
|
@distance_map ||= (
|
232
236
|
Vowels.phonemes + Consonants.phonemes
|
233
|
-
).permutation(2).each_with_object(Hash.new { |h, k| h[k] = {} }
|
237
|
+
).permutation(2).each_with_object(Hash.new { |h, k| h[k] = {} }) do |pair, scores|
|
234
238
|
p1, p2 = *pair
|
235
239
|
score = _distance(p1, p2)
|
236
240
|
scores[p1][p2] = score
|
@@ -253,7 +257,7 @@ module Phonetics
|
|
253
257
|
# => 1413 (624 + (10 * 778))
|
254
258
|
def grapheme_as_utf_8_long(grapheme)
|
255
259
|
grapheme.unpack('U*').each_with_index.reduce(0) do |total, (byte, i)|
|
256
|
-
total
|
260
|
+
total + (10**i) * byte
|
257
261
|
end
|
258
262
|
end
|
259
263
|
|
@@ -299,7 +303,7 @@ module Phonetics
|
|
299
303
|
distances.each do |(b, b_i), distance|
|
300
304
|
writer.puts " case #{b_i}: // #{a}->#{b}"
|
301
305
|
writer.puts " return (float) #{distance};"
|
302
|
-
writer.puts
|
306
|
+
writer.puts ' break;'
|
303
307
|
end
|
304
308
|
writer.puts ' }'
|
305
309
|
end
|
@@ -312,11 +316,11 @@ module Phonetics
|
|
312
316
|
|
313
317
|
def _distance(phoneme1, phoneme2)
|
314
318
|
types = [Symbols.fetch(phoneme1), Symbols.fetch(phoneme2)].sort
|
315
|
-
if types == [
|
319
|
+
if types == %i[consonant vowel]
|
316
320
|
1.0
|
317
|
-
elsif types == [
|
321
|
+
elsif types == %i[vowel vowel]
|
318
322
|
Vowels.distance(phoneme1, phoneme2)
|
319
|
-
elsif types == [
|
323
|
+
elsif types == %i[consonant consonant]
|
320
324
|
Consonants.distance(phoneme1, phoneme2)
|
321
325
|
end
|
322
326
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'c_levenshtein'
|
2
4
|
# Using the Damerau version of the Levenshtein algorithm, with phonetic feature
|
3
5
|
# count used instead of a binary edit distance calculation
|
@@ -17,7 +19,7 @@ module Phonetics
|
|
17
19
|
ensure_is_phonetic!(str1, str2)
|
18
20
|
internal_phonetic_distance(
|
19
21
|
Phonetics.as_utf_8_long(str1),
|
20
|
-
Phonetics.as_utf_8_long(str2)
|
22
|
+
Phonetics.as_utf_8_long(str2)
|
21
23
|
)
|
22
24
|
end
|
23
25
|
|
@@ -25,11 +27,11 @@ module Phonetics
|
|
25
27
|
[str1, str2].each do |string|
|
26
28
|
string.chars.each do |char|
|
27
29
|
unless Phonetics.phonemes.include?(char)
|
28
|
-
|
30
|
+
msg = "#{char.inspect} is not a character in the International Phonetic Alphabet. #{self.class.name} only works with IPA-transcribed strings"
|
31
|
+
raise ArgumentError, msg
|
29
32
|
end
|
30
33
|
end
|
31
34
|
end
|
32
35
|
end
|
33
|
-
|
34
36
|
end
|
35
37
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative '../phonetics'
|
2
4
|
|
3
5
|
# Using the Damerau version of the Levenshtein algorithm, with phonetic feature
|
@@ -12,7 +14,6 @@ require_relative '../phonetics'
|
|
12
14
|
# https://hal.archives-ouvertes.fr/hal-01474904/document
|
13
15
|
module Phonetics
|
14
16
|
class RubyLevenshtein
|
15
|
-
|
16
17
|
attr_reader :str1, :str2, :len1, :len2, :matrix
|
17
18
|
|
18
19
|
def initialize(ipa_str1, ipa_str2, verbose = false)
|
@@ -28,6 +29,7 @@ module Phonetics
|
|
28
29
|
|
29
30
|
def distance
|
30
31
|
return 0 if walk.empty?
|
32
|
+
|
31
33
|
print_matrix if @verbose
|
32
34
|
walk.last[:distance]
|
33
35
|
end
|
@@ -41,21 +43,22 @@ module Phonetics
|
|
41
43
|
def ensure_is_phonetic!
|
42
44
|
[str1, str2].each do |string|
|
43
45
|
string.chars.each do |char|
|
44
|
-
unless Phonetics.phonemes.include?(char)
|
45
|
-
raise ArgumentError, "#{char.inspect} is not a character in the International Phonetic Alphabet. #{self.class.name} only works with IPA-transcribed strings"
|
46
|
-
end
|
46
|
+
raise ArgumentError, "#{char.inspect} is not a character in the International Phonetic Alphabet. #{self.class.name} only works with IPA-transcribed strings" unless Phonetics.phonemes.include?(char)
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
def walk
|
52
52
|
res = []
|
53
|
-
i
|
53
|
+
i = len2
|
54
|
+
j = len1
|
54
55
|
return res if i == 0 && j == 0
|
55
|
-
|
56
|
+
|
57
|
+
loop do
|
56
58
|
i, j, char = char_data(i, j)
|
57
59
|
res.unshift char
|
58
|
-
|
60
|
+
break if i == 0 || j == 0
|
61
|
+
end
|
59
62
|
res
|
60
63
|
end
|
61
64
|
|
@@ -67,13 +70,13 @@ module Phonetics
|
|
67
70
|
options = [
|
68
71
|
ins(i, j),
|
69
72
|
del(i, j),
|
70
|
-
subst(i, j)
|
73
|
+
subst(i, j)
|
71
74
|
]
|
72
75
|
# This is where we implement the modifications to Damerau-Levenshtein
|
73
76
|
# according to https://hal.archives-ouvertes.fr/hal-01474904/document
|
74
77
|
phonetic_cost = Phonetics.distance(str1[j - 1], str2[i - 1])
|
75
78
|
matrix[i][j] = options.min + phonetic_cost
|
76
|
-
puts "------- #{j}/#{i} #{j + (i*(len1+1))}" if @verbose
|
79
|
+
puts "------- #{j}/#{i} #{j + (i * (len1 + 1))}" if @verbose
|
77
80
|
print_matrix if @verbose
|
78
81
|
end
|
79
82
|
end
|
@@ -90,16 +93,16 @@ module Phonetics
|
|
90
93
|
|
91
94
|
def find_previous(i, j)
|
92
95
|
[
|
93
|
-
[
|
94
|
-
[
|
95
|
-
[
|
96
|
-
].select do |
|
96
|
+
[:insert, { cost: ins(i, j), move_to: [i, j - 1] }],
|
97
|
+
[:delete, { cost: del(i, j), move_to: [i, j - 1] }],
|
98
|
+
[:substitute, { cost: subst(i, j), move_to: [i, j - 1] }]
|
99
|
+
].select do |_operation, data|
|
97
100
|
# Don't send us out of bounds
|
98
101
|
data[:move_to][0] >= 0 && data[:move_to][1] >= 0
|
99
|
-
end.
|
102
|
+
end.min_by do |_operation, data|
|
100
103
|
# pick the cheapest one
|
101
104
|
data[:value]
|
102
|
-
end
|
105
|
+
end
|
103
106
|
end
|
104
107
|
|
105
108
|
# TODO: Score the edit distance lower if sonorant sounds are found in sequence.
|
@@ -125,20 +128,20 @@ module Phonetics
|
|
125
128
|
# phoneme within the same string.
|
126
129
|
# "aek" -> [0, 1, 1.61, 2.61]
|
127
130
|
def initial_distances(str1, str2)
|
128
|
-
if len1 == 0 || len2 == 0
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
distances1 = (1..(str1.length-1)).reduce([0, starting_distance]) do |acc, i|
|
135
|
-
acc << acc.last + Phonetics.distance(str1[i-1], str1[i])
|
131
|
+
starting_distance = if len1 == 0 || len2 == 0
|
132
|
+
0
|
133
|
+
else
|
134
|
+
Phonetics.distance(str1[0], str2[0])
|
135
|
+
end
|
136
|
+
|
137
|
+
distances1 = (1..(str1.length - 1)).reduce([0, starting_distance]) do |acc, i|
|
138
|
+
acc << acc.last + Phonetics.distance(str1[i - 1], str1[i])
|
136
139
|
end
|
137
|
-
distances2 = (1..(str2.length-1)).reduce([0, starting_distance]) do |acc, i|
|
138
|
-
acc << acc.last + Phonetics.distance(str2[i-1], str2[i])
|
140
|
+
distances2 = (1..(str2.length - 1)).reduce([0, starting_distance]) do |acc, i|
|
141
|
+
acc << acc.last + Phonetics.distance(str2[i - 1], str2[i])
|
139
142
|
end
|
140
143
|
|
141
|
-
[
|
144
|
+
[distances1, distances2]
|
142
145
|
end
|
143
146
|
|
144
147
|
def prepare_matrix
|
@@ -154,11 +157,11 @@ module Phonetics
|
|
154
157
|
# This is a helper method for developers to use when exploring this
|
155
158
|
# algorithm.
|
156
159
|
def print_matrix
|
157
|
-
puts " #{str1.chars.map {|c| c.ljust(9,
|
160
|
+
puts " #{str1.chars.map { |c| c.ljust(9, ' ') }.join}"
|
158
161
|
matrix.each_with_index do |row, ridx|
|
159
162
|
print ' ' if ridx == 0
|
160
163
|
print "#{str2[ridx - 1]} " if ridx > 0
|
161
|
-
row.each_with_index do |cell,
|
164
|
+
row.each_with_index do |cell, _cidx|
|
162
165
|
cell ||= 0.0
|
163
166
|
print cell.to_s[0, 8].ljust(8, '0')
|
164
167
|
print ' '
|
data/lib/phonetics/version.rb
CHANGED
data/phonetics.gemspec
CHANGED
@@ -1,26 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Gem::Specification.new do |spec|
|
2
|
-
spec.name =
|
4
|
+
spec.name = 'phonetics'
|
3
5
|
spec.version = File.read(File.join(File.dirname(__FILE__), './VERSION'))
|
4
|
-
spec.authors = [
|
5
|
-
spec.email = [
|
6
|
+
spec.authors = ['Jack Danger']
|
7
|
+
spec.email = ['github@jackcanty.com']
|
8
|
+
|
9
|
+
spec.summary = 'tools for linguistic code using the International Phonetic Alphabet'
|
10
|
+
spec.description = 'tools for linguistic code using the International Phonetic Alphabet'
|
11
|
+
spec.homepage = 'https://github.com/JackDanger/phonetics'
|
12
|
+
spec.license = 'MIT'
|
13
|
+
|
6
14
|
|
7
|
-
spec.
|
8
|
-
spec.description = %q{tools for linguistic code using the International Phonetic Alphabet}
|
9
|
-
spec.homepage = "https://github.com/JackDanger/phonetics"
|
10
|
-
spec.license = "MIT"
|
15
|
+
spec.extensions = ["ext/c_levenshtein/extconf.rb"]
|
11
16
|
|
12
17
|
# Specify which files should be added to the gem when it is released.
|
13
18
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
14
|
-
spec.files = Dir.chdir(File.expand_path(
|
19
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
15
20
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
21
|
end
|
17
|
-
spec.require_paths = [
|
22
|
+
spec.require_paths = ['lib']
|
18
23
|
|
19
|
-
spec.add_development_dependency
|
20
|
-
spec.add_development_dependency
|
21
|
-
spec.add_development_dependency "rubocop", "~> 0.52"
|
22
|
-
spec.add_development_dependency "ruby-prof", "~> 0.17"
|
23
|
-
spec.add_development_dependency 'bundler', '~> 1.16'
|
24
|
+
spec.add_development_dependency 'bundler'
|
25
|
+
spec.add_development_dependency 'pry-byebug'
|
24
26
|
spec.add_development_dependency 'rake'
|
25
|
-
spec.add_development_dependency '
|
27
|
+
spec.add_development_dependency 'rake-compiler'
|
28
|
+
spec.add_development_dependency 'rspec'
|
29
|
+
spec.add_development_dependency 'rubocop'
|
26
30
|
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: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Danger
|
@@ -11,7 +11,7 @@ cert_chain: []
|
|
11
11
|
date: 2019-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,63 +25,49 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rubocop
|
28
|
+
name: pry-byebug
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
|
-
- - "
|
31
|
+
- - ">="
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0
|
33
|
+
version: '0'
|
48
34
|
type: :development
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
|
-
- - "
|
38
|
+
- - ">="
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0
|
40
|
+
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
42
|
+
name: rake
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- - "
|
45
|
+
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0
|
47
|
+
version: '0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - "
|
52
|
+
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0
|
54
|
+
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
56
|
+
name: rake-compiler
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- - "
|
59
|
+
- - ">="
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
61
|
+
version: '0'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- - "
|
66
|
+
- - ">="
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
68
|
+
version: '0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
70
|
+
name: rspec
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - ">="
|
@@ -95,33 +81,34 @@ dependencies:
|
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
84
|
+
name: rubocop
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
|
-
- - "
|
87
|
+
- - ">="
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
89
|
+
version: '0'
|
104
90
|
type: :development
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
|
-
- - "
|
94
|
+
- - ">="
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
96
|
+
version: '0'
|
111
97
|
description: tools for linguistic code using the International Phonetic Alphabet
|
112
98
|
email:
|
113
99
|
- github@jackcanty.com
|
114
100
|
executables: []
|
115
|
-
extensions:
|
101
|
+
extensions:
|
102
|
+
- ext/c_levenshtein/extconf.rb
|
116
103
|
extra_rdoc_files: []
|
117
104
|
files:
|
118
105
|
- ".github/workflows/gempush.yml"
|
119
106
|
- ".gitignore"
|
120
107
|
- ".rspec"
|
108
|
+
- ".rubocop.yml"
|
121
109
|
- ".travis.yml"
|
122
110
|
- CODE_OF_CONDUCT.md
|
123
111
|
- Gemfile
|
124
|
-
- Gemfile.lock
|
125
112
|
- LICENSE.txt
|
126
113
|
- README.md
|
127
114
|
- Rakefile
|
data/Gemfile.lock
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
phonetics (1.1.1)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
ast (2.4.0)
|
10
|
-
byebug (11.0.1)
|
11
|
-
coderay (1.1.2)
|
12
|
-
diff-lcs (1.3)
|
13
|
-
jaro_winkler (1.5.2)
|
14
|
-
method_source (0.9.2)
|
15
|
-
parallel (1.17.0)
|
16
|
-
parser (2.6.3.0)
|
17
|
-
ast (~> 2.4.0)
|
18
|
-
pry (0.12.2)
|
19
|
-
coderay (~> 1.1.0)
|
20
|
-
method_source (~> 0.9.0)
|
21
|
-
pry-byebug (3.7.0)
|
22
|
-
byebug (~> 11.0)
|
23
|
-
pry (~> 0.10)
|
24
|
-
rainbow (3.0.0)
|
25
|
-
rake (12.3.2)
|
26
|
-
rake-compiler (1.0.7)
|
27
|
-
rake
|
28
|
-
rspec (3.8.0)
|
29
|
-
rspec-core (~> 3.8.0)
|
30
|
-
rspec-expectations (~> 3.8.0)
|
31
|
-
rspec-mocks (~> 3.8.0)
|
32
|
-
rspec-core (3.8.0)
|
33
|
-
rspec-support (~> 3.8.0)
|
34
|
-
rspec-expectations (3.8.2)
|
35
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
36
|
-
rspec-support (~> 3.8.0)
|
37
|
-
rspec-mocks (3.8.0)
|
38
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
39
|
-
rspec-support (~> 3.8.0)
|
40
|
-
rspec-support (3.8.0)
|
41
|
-
rubocop (0.69.0)
|
42
|
-
jaro_winkler (~> 1.5.1)
|
43
|
-
parallel (~> 1.10)
|
44
|
-
parser (>= 2.6)
|
45
|
-
rainbow (>= 2.2.2, < 4.0)
|
46
|
-
ruby-progressbar (~> 1.7)
|
47
|
-
unicode-display_width (>= 1.4.0, < 1.7)
|
48
|
-
ruby-prof (0.17.0)
|
49
|
-
ruby-progressbar (1.10.0)
|
50
|
-
unicode-display_width (1.6.0)
|
51
|
-
|
52
|
-
PLATFORMS
|
53
|
-
ruby
|
54
|
-
|
55
|
-
DEPENDENCIES
|
56
|
-
bundler (~> 1.16)
|
57
|
-
phonetics!
|
58
|
-
pry-byebug
|
59
|
-
rake
|
60
|
-
rake-compiler (~> 1.0)
|
61
|
-
rspec (~> 3.0)
|
62
|
-
rubocop (~> 0.52)
|
63
|
-
ruby-prof (~> 0.17)
|
64
|
-
|
65
|
-
BUNDLED WITH
|
66
|
-
1.17.2
|