phoneme 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -1
- data/lib/phoneme.rb +17 -13
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69c05db3dbd11b241c5c29a55600d51e039af240
|
4
|
+
data.tar.gz: 77023e24fc7bf45c2a35ab61fedf280c3e6f4e43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 544d5a34f0292b915f23e6b6a4649dbdfb2b2bd1dd56d8d3ff8fae6748ea5884a36c394fcb97ed8ad05283ab4f96c8fb56b43fc730ebd13b89894c3d0ff3b4a6
|
7
|
+
data.tar.gz: ffee3bf8405037478d11ec7c7a6ef0795e0eddcf54cebc24be61f6791115a80bef6508c81b128db449a6696ffafff922691eaa2bb4214ac3e5a97a6265c42a48
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
H �Qރ�U�rY���z"����Q�(u"�L��,,pfXm�q8Q�U�x6�����/�q��%�z)|�(K��O��J�,����.��N� �#D�ʺ�������i:vC_�f���TĢ1��8�����=p�%#y� ~�/�{�C?Jf-^w4�{�n��Dm���s8|�jQm����@�!mGV�ҽ-�9�%��h�H��"<�5��k/�0x���9W,�"M�v�}W̳���"�l�?��:�c
|
data/lib/phoneme.rb
CHANGED
@@ -16,34 +16,38 @@ class Phoneme
|
|
16
16
|
def initialize(s)
|
17
17
|
|
18
18
|
@a = [
|
19
|
-
{ey: /^a.[eo]/, ae: /^a.*/ },
|
19
|
+
{ey: /^a.[eo]/, ah: /^a$/, ae: /^a.*/ },
|
20
20
|
:b,
|
21
21
|
{k: /^ca|^co/, ch: /^(ch)/,s: /^ce|^c.*/},
|
22
|
-
:d,
|
23
|
-
{iy: /^
|
22
|
+
{d: /^(de)$|^d.*/},
|
23
|
+
{iy: /^(e[eayi])|^e$/, eh: /^e.*/},
|
24
24
|
:f,
|
25
25
|
{jh: /^ge/, :'' => /^(gh)/, g: /^g.*/},
|
26
26
|
{hh: /^h.*/},
|
27
|
-
{ay: /^i$|^ie|^igh|^i.e/, ih: /^i.*/},
|
27
|
+
{ay: /^i$|^(ie)|^igh|^i.e/, ih: /^i.*/},
|
28
28
|
:jh,
|
29
|
-
{n: /^kn/, k: /^k.*/},
|
30
|
-
:l,
|
31
|
-
{m: /^(me)|^m/},
|
32
|
-
{ng: /^ng/, n: /^n.*/},
|
33
|
-
{ow: /^oa|^o$/, oy: /^oy/, uh: /^(oo)/, ao: /^(ou)/, aw: /^(o[uw])/, ah: /^om|^pl/, aa: /^(o).*/},
|
29
|
+
{n: /^(kn)/, k: /^k.*/},
|
30
|
+
{l: /^(le)$|^l.*/},
|
31
|
+
{m: /^me$|^(me)|^m/},
|
32
|
+
{ng: /^(ng)/, n: /^n.*/},
|
33
|
+
{ow: /^(oa)|^o$/, oy: /^(oy)/, uh: /^(oo)/, ao: /^(ou)/, aw: /^(o[uw])/, ah: /^om|^pl/, aa: /^(o).*/},
|
34
34
|
{p: /^p.*/},
|
35
35
|
:q,
|
36
36
|
:r,
|
37
|
-
{sh: /^(sh)/, s: /^s.*/},
|
38
|
-
{th: /^(th)/, t: /^t.*/},
|
37
|
+
{sh: /^(sh)/, z: /^(se)$/, s: /^s.*/},
|
38
|
+
{th: /^(th)/, t: /^(te)$|^t.*/},
|
39
39
|
{uw: /^(u)b|^(u)de/, er: /^(ur)/, ah: /^u.*/},
|
40
40
|
:v,
|
41
|
-
{w: /^(wh)|^w.*/},
|
41
|
+
{uw: /^(wo)/, w: /^(wh)|^w.*/},
|
42
42
|
{z: /^xy/, e: /^x.*/},
|
43
|
+
:y,
|
43
44
|
{zh: /^zu/, z: /^z.*/}
|
44
45
|
]
|
45
46
|
|
46
|
-
@to_s = phonemize(s
|
47
|
+
@to_s = phonemize(s.downcase)\
|
48
|
+
.sub(/ m iy$/,' m').sub(/th( iy)$/,'dh\1')\
|
49
|
+
.sub(/th eh t /, 'th ey t ').sub(/^(y )ay( l )/,'\1iy\2')\
|
50
|
+
.sub(/er iy$/,'er').rstrip.upcase
|
47
51
|
end
|
48
52
|
|
49
53
|
private
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|