phonetics 3.0.8 → 3.0.9

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
  SHA256:
3
- metadata.gz: 6d643b3ab5556532c58d98e833a24d5d51fb63f2ad35cfe3c9a6d45cda7857f1
4
- data.tar.gz: 70151659ab727a05ebdc940ef9fc9135fb90f7ffbf84457a3f81ce66ef470ea5
3
+ metadata.gz: 1e47d71b000fa07bd5cdfdf7e2321512370020280e1d9b227547f21673f8f533
4
+ data.tar.gz: f917449d2c0f4276b3fd214506e99fd12621f4af1fedfebc7f5bcaff62c22ee1
5
5
  SHA512:
6
- metadata.gz: 81399b9bacb9eb9f66bc149f2b628f877f6e18cb5009c897db93065a5311e5b90dce62c8d3b5dedd4aff25009c66da30ba1484be21beea3f318cdfda67be25d4
7
- data.tar.gz: 76225613a5a2a1865637a0ad0673129e1923235242aa6d46239098c95bf69d0e40c9c220c550249ba62f8285d50f6ae17fb27dc0e533af9f22e983badfc4042a
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
- - master
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 2.6
16
- uses: actions/setup-ruby@v1
15
+ - name: Set up Ruby 3.1
16
+ uses: ruby/setup-ruby@v1
17
17
  with:
18
- ruby-version: 2.6.x
18
+ ruby-version: 3.1.1
19
19
 
20
20
  - name: Publish to RubyGems
21
21
  run: |
@@ -9,13 +9,11 @@ jobs:
9
9
  strategy:
10
10
  matrix:
11
11
  ruby:
12
- - '2.5.x'
13
- - '2.6.x'
14
- - '3.1.x'
12
+ - '3.1.5'
13
+ - '3.3.1'
15
14
  steps:
16
- - uses: actions/checkout@master
17
- - name: Setup ruby
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
@@ -45,4 +45,6 @@ Style/TrailingCommaInHashLiteral:
45
45
 
46
46
  Layout/HashAlignment:
47
47
  EnforcedHashRocketStyle: separator
48
- EnforcedColonStyle: separator
48
+
49
+ Gemspec/RequiredRubyVersion:
50
+ Enabled: false
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.8
1
+ 3.0.9
@@ -67,7 +67,7 @@ module Phonetics
67
67
 
68
68
  def ruby_source
69
69
  location = caller_locations.first
70
- "#{location.path.split('/')[-4..-1].join('/')}:#{location.lineno}"
70
+ "#{location.path.split('/')[-4..].join('/')}:#{location.lineno}"
71
71
  end
72
72
 
73
73
  def indent(depth, line)
@@ -155,9 +155,9 @@ module Phonetics
155
155
  manner.strip!
156
156
  positions.zip(columns).each do |position, phoneme_text|
157
157
  data = {
158
- position: position,
158
+ position: position,
159
159
  position_index: position_indexes[position],
160
- manner: manner,
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..-1]
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
- word: key,
127
+ word: key,
124
128
  rarity: entry['rarity'],
125
129
  }
126
- entry.fetch('ipa', []).each do |_source, transcription|
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..-1], entry_data, depth + 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.8
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: 2022-05-02 00:00:00.000000000 Z
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.0.3.1
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