voxbi 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/modules/timeoutable.rb +11 -0
- data/lib/services/get_pairs_service.rb +3 -1
- data/lib/services/phonetics_converter_service.rb +3 -11
- data/voxbi-1.0.5.gem +0 -0
- data/voxbi.gemspec +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09d5b0a2815bb800e3b9bc30b31c9033ffcfac69
|
4
|
+
data.tar.gz: 9e9e875c17139f514b70171d0225466187920a87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ce6964e0284dfc6cc53f728894da94cc35b6f699f05b8cfc9b02e99d75967f9e663abef91cc0ea1904d8aa2c0999ce5a9d75b9d588931ab01877d1176fc014d
|
7
|
+
data.tar.gz: 973a6d97ce259e90c45d2163d014271e9f76cb29c2a6761af9465606458d90815feb9501c2617c63e9fddfa8ffeb7749908bf2ee21a63f86a9c8fc8844791f06
|
@@ -1,4 +1,6 @@
|
|
1
1
|
class GetPairsService
|
2
|
+
include Timeoutable
|
3
|
+
|
2
4
|
attr_reader :phonetic_text
|
3
5
|
|
4
6
|
def initialize(phonetic_text)
|
@@ -20,7 +22,7 @@ class GetPairsService
|
|
20
22
|
while word.length != 0
|
21
23
|
matching_pair = RuleStore.available_pairs.detect{ |pair| word.match(/^#{pair}/) }
|
22
24
|
word.sub!(/^#{matching_pair}/,"")
|
23
|
-
pairs << matching_pair
|
25
|
+
pairs << matching_pair.dup
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
@@ -1,8 +1,5 @@
|
|
1
|
-
require "timeout"
|
2
|
-
|
3
1
|
class PhoneticsConverterService
|
4
|
-
|
5
|
-
|
2
|
+
include Timeoutable
|
6
3
|
attr_accessor :word, :phonetized_word
|
7
4
|
|
8
5
|
def initialize(word)
|
@@ -12,17 +9,10 @@ class PhoneticsConverterService
|
|
12
9
|
|
13
10
|
def call
|
14
11
|
with_timeout { phonetize_word }
|
15
|
-
phonetized_word
|
16
12
|
end
|
17
13
|
|
18
14
|
private
|
19
15
|
|
20
|
-
def with_timeout(&block)
|
21
|
-
Timeout::timeout(DEFAULT_TIMEOUT) do
|
22
|
-
block.call
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
16
|
def phonetize_word
|
27
17
|
dup_word = word.dup
|
28
18
|
|
@@ -32,6 +22,8 @@ class PhoneticsConverterService
|
|
32
22
|
phonetized_word << phonetic.to_s
|
33
23
|
end
|
34
24
|
end
|
25
|
+
|
26
|
+
phonetized_word
|
35
27
|
end
|
36
28
|
|
37
29
|
def conversion_rule_for(word)
|
data/voxbi-1.0.5.gem
ADDED
Binary file
|
data/voxbi.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voxbi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Galaad Gauthier
|
@@ -319,6 +319,7 @@ files:
|
|
319
319
|
- data/pairs/ϵ.ogg
|
320
320
|
- lib/extensions/string.rb
|
321
321
|
- lib/modules/rule_parsable.rb
|
322
|
+
- lib/modules/timeoutable.rb
|
322
323
|
- lib/rule_store.rb
|
323
324
|
- lib/services/get_pairs_service.rb
|
324
325
|
- lib/services/get_syllables_service.rb
|
@@ -328,6 +329,7 @@ files:
|
|
328
329
|
- lib/voxbi.rb
|
329
330
|
- voxbi-1.0.1.gem
|
330
331
|
- voxbi-1.0.4.gem
|
332
|
+
- voxbi-1.0.5.gem
|
331
333
|
- voxbi-1.0.gem
|
332
334
|
- voxbi.gemspec
|
333
335
|
homepage: https://github.com/Galaad-Gauthier/VoxBi
|