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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d58b1f0a00cfcd77246e62a9e96eda6d6a859645
4
- data.tar.gz: 1d8d6d3f1e2592da2227a8c26c7f0043bd906495
3
+ metadata.gz: 69c05db3dbd11b241c5c29a55600d51e039af240
4
+ data.tar.gz: 77023e24fc7bf45c2a35ab61fedf280c3e6f4e43
5
5
  SHA512:
6
- metadata.gz: 487ecf9cd3149ad360b3cbdd0496d6cf316fbcfda7b2505be7763390719cdc1c557ef2e963ad59b022118a6fa88989163ab2abd6249b2ca0cde3aaf576785d6e
7
- data.tar.gz: d39a77084fd5b67487a256af43ddb816762c84f9b72ddef47f21a5ca8a90657b30f0e934194322e78d0c507dcea59a0ca313eacd31060466288e174291beb3a1
6
+ metadata.gz: 544d5a34f0292b915f23e6b6a4649dbdfb2b2bd1dd56d8d3ff8fae6748ea5884a36c394fcb97ed8ad05283ab4f96c8fb56b43fc730ebd13b89894c3d0ff3b4a6
7
+ data.tar.gz: ffee3bf8405037478d11ec7c7a6ef0795e0eddcf54cebc24be61f6791115a80bef6508c81b128db449a6696ffafff922691eaa2bb4214ac3e5a97a6265c42a48
checksums.yaml.gz.sig CHANGED
@@ -1 +1 @@
1
- <&���N+�i�]_qCO��{s��a�΢w\ xT.�1@]d+Y�5n7Ǵ ��8SDW��R_�F�¥Q��H#�6jH V]��H0�<��\X���;ca��>z���7գ���x��}b��P[�M�����P��@�%��Y};Gv"s�9_;l%f`y�n�jH��̻\�yk���8 `'���<�V�s� ��MvvM����M�����w����8],�Nj�Ң�]���Nj���
1
+ H Qރ�UrY���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�%��hH��"<�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: /^ee|^e$/, eh: /^e.*/},
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).sub(/e$/,'').sub(/([ld]) iy$/,'\1').rstrip.upcase
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phoneme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file