ipa_phonetics 0.1.1 → 0.1.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/ipa_phonetics.gemspec +1 -1
- data/lib/ipa_phonetics.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 374298034b82bcef59d30ece27896762ad79a22e2b3c5413f6814544d1b59e4e
|
4
|
+
data.tar.gz: 0e7bf2b5111a1f6d72a2fea94386611e2442b1315a3460020e8dd37e79a94a56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cac999ad6f32fa690778d2a3d84e693c97ba07a9c3705569cc93b9a80e2b648a08740e5debed0dab37380f20b54aeb83590ceeeca79815ba05486e1f3fcfbf00
|
7
|
+
data.tar.gz: 265fc4f7cb30c01b349778a3b589d3c4876cc3069cc912f3742d2e05f6d7def0d72a6873a8efc478a92ff75271a41556aeb56023059ba30c90bd256783342b5c
|
data/ipa_phonetics.gemspec
CHANGED
data/lib/ipa_phonetics.rb
CHANGED
@@ -9,27 +9,27 @@ module IpaPhonetics
|
|
9
9
|
|
10
10
|
@timeout = 1
|
11
11
|
|
12
|
-
def parseCSV(path)
|
12
|
+
def self.parseCSV(path)
|
13
13
|
Hash[File.open("#{ROOT}/data/#{path}.csv").read.split("\n").map {|ligne| ligne.split("#")}]
|
14
14
|
end
|
15
15
|
|
16
|
-
def exceptions
|
16
|
+
def self.exceptions
|
17
17
|
@exceptions ||= JSON.parse(File.read("#{ROOT}/data/dict.json"))
|
18
18
|
end
|
19
19
|
|
20
|
-
def conversion
|
20
|
+
def self.conversion
|
21
21
|
@conversion ||= parseCSV "conversion"
|
22
22
|
end
|
23
23
|
|
24
|
-
def set_timeout(seconds)
|
24
|
+
def self.set_timeout(seconds)
|
25
25
|
@timeout = seconds
|
26
26
|
end
|
27
27
|
|
28
|
-
def timeout
|
28
|
+
def self.timeout
|
29
29
|
@timeout
|
30
30
|
end
|
31
31
|
|
32
|
-
def get(text)
|
32
|
+
def self.get(text)
|
33
33
|
text = text.downcase
|
34
34
|
text.gsub(SPE, "").split.map do |word|
|
35
35
|
exceptions[word] || "".tap do |result|
|