phonetics 3.0.8 → 3.0.9
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/.github/workflows/gempush.yml +4 -4
- data/.github/workflows/test.yml +4 -6
- data/.rubocop.yml +3 -1
- data/VERSION +1 -1
- data/lib/phonetics/code_generator.rb +1 -1
- data/lib/phonetics/distances.rb +3 -3
- data/lib/phonetics/transcriptions.rb +7 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e47d71b000fa07bd5cdfdf7e2321512370020280e1d9b227547f21673f8f533
|
4
|
+
data.tar.gz: f917449d2c0f4276b3fd214506e99fd12621f4af1fedfebc7f5bcaff62c22ee1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f804627ad6de25b5c9cadef635abd957fb29eea9f7a7a9be7701b98c07c34afd1d6938135b66887a853a50e88d78a2680f9314ad7ee513513f598209ce703015
|
7
|
+
data.tar.gz: c8300d8122b3539da7fe1b687edd0c7a2d4afc98bd908568925a0153d378bb4c73daf6c8a39b5f12524645da942311dc4f469a1650999c90b1c4e34fb7e203d7
|
@@ -3,7 +3,7 @@ name: Ruby Gem
|
|
3
3
|
on:
|
4
4
|
push:
|
5
5
|
branches:
|
6
|
-
-
|
6
|
+
- main
|
7
7
|
|
8
8
|
jobs:
|
9
9
|
build:
|
@@ -12,10 +12,10 @@ jobs:
|
|
12
12
|
|
13
13
|
steps:
|
14
14
|
- uses: actions/checkout@master
|
15
|
-
- name: Set up Ruby
|
16
|
-
uses:
|
15
|
+
- name: Set up Ruby 3.1
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
17
|
with:
|
18
|
-
ruby-version:
|
18
|
+
ruby-version: 3.1.1
|
19
19
|
|
20
20
|
- name: Publish to RubyGems
|
21
21
|
run: |
|
data/.github/workflows/test.yml
CHANGED
@@ -9,13 +9,11 @@ jobs:
|
|
9
9
|
strategy:
|
10
10
|
matrix:
|
11
11
|
ruby:
|
12
|
-
- '
|
13
|
-
- '
|
14
|
-
- '3.1.x'
|
12
|
+
- '3.1.5'
|
13
|
+
- '3.3.1'
|
15
14
|
steps:
|
16
|
-
- uses: actions/checkout@
|
17
|
-
-
|
18
|
-
uses: actions/setup-ruby@v1
|
15
|
+
- uses: actions/checkout@v4
|
16
|
+
- uses: ruby/setup-ruby@v1
|
19
17
|
with:
|
20
18
|
ruby-version: ${{ matrix.ruby }}
|
21
19
|
architecture: 'x64'
|
data/.rubocop.yml
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.9
|
data/lib/phonetics/distances.rb
CHANGED
@@ -155,9 +155,9 @@ module Phonetics
|
|
155
155
|
manner.strip!
|
156
156
|
positions.zip(columns).each do |position, phoneme_text|
|
157
157
|
data = {
|
158
|
-
|
158
|
+
position: position,
|
159
159
|
position_index: position_indexes[position],
|
160
|
-
|
160
|
+
manner: manner,
|
161
161
|
}
|
162
162
|
# If there is a character in the first byte then this articulation
|
163
163
|
# has a voiceless phoneme. The symbol may use additional characters
|
@@ -165,7 +165,7 @@ module Phonetics
|
|
165
165
|
unless phoneme_text[0] == ' '
|
166
166
|
# Take the first non-blank character string
|
167
167
|
symbol = phoneme_text.chars.take_while { |char| char != ' ' }.join
|
168
|
-
phoneme_text = phoneme_text[symbol.chars.size
|
168
|
+
phoneme_text = phoneme_text[symbol.chars.size..]
|
169
169
|
|
170
170
|
phonemes[symbol] = data.merge(voiced: false)
|
171
171
|
end
|
@@ -29,6 +29,10 @@ module Phonetics
|
|
29
29
|
nil
|
30
30
|
end
|
31
31
|
|
32
|
+
def words
|
33
|
+
transcriptions.keys
|
34
|
+
end
|
35
|
+
|
32
36
|
def transcriptions
|
33
37
|
@transcriptions ||= begin
|
34
38
|
download! unless File.exist?(TranscriptionFile)
|
@@ -120,10 +124,10 @@ module Phonetics
|
|
120
124
|
next if max_rarity && (entry['rarity'].nil? || entry['rarity'] > max_rarity)
|
121
125
|
|
122
126
|
entry_data = {
|
123
|
-
|
127
|
+
word: key,
|
124
128
|
rarity: entry['rarity'],
|
125
129
|
}
|
126
|
-
entry.fetch('ipa', []).
|
130
|
+
entry.fetch('ipa', []).each_value do |transcription|
|
127
131
|
base_trie = construct_trie(base_trie, transcription, entry_data)
|
128
132
|
end
|
129
133
|
end
|
@@ -155,7 +159,7 @@ module Phonetics
|
|
155
159
|
next_char = chars_remaining[0]
|
156
160
|
subtrie[next_char] ||= {}
|
157
161
|
subtrie[next_char][:path] ||= subtrie[:path].to_s + next_char
|
158
|
-
subtrie[next_char] = construct_trie(subtrie[next_char], chars_remaining[1
|
162
|
+
subtrie[next_char] = construct_trie(subtrie[next_char], chars_remaining[1..], entry_data, depth + 1)
|
159
163
|
end
|
160
164
|
subtrie
|
161
165
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phonetics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Danger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
|
-
rubygems_version: 3.
|
159
|
+
rubygems_version: 3.3.7
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
162
|
summary: tools for linguistic code using the International Phonetic Alphabet
|