ruby_rhymes 0.1.0 → 0.1.1
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.
- data/README.md +1 -1
- data/README.rdoc +1 -0
- data/doc/classes/Phrase.html +269 -0
- data/doc/classes/Phrase.src/M000001.html +22 -0
- data/doc/classes/Phrase.src/M000002.html +18 -0
- data/doc/classes/Phrase.src/M000003.html +18 -0
- data/doc/classes/Phrase.src/M000004.html +18 -0
- data/doc/classes/Phrase.src/M000005.html +18 -0
- data/doc/classes/Phrase.src/M000006.html +19 -0
- data/doc/classes/Phrase.src/M000007.html +18 -0
- data/doc/classes/Phrase/Pronunciation.html +206 -0
- data/doc/classes/Phrase/Pronunciation.src/M000010.html +21 -0
- data/doc/classes/Phrase/Pronunciation.src/M000011.html +18 -0
- data/doc/classes/Phrase/Pronunciation.src/M000012.html +18 -0
- data/doc/classes/Phrase/Pronunciations.html +210 -0
- data/doc/classes/Phrase/Pronunciations.src/M000008.html +29 -0
- data/doc/classes/Phrase/Pronunciations.src/M000009.html +22 -0
- data/doc/classes/String.html +137 -0
- data/doc/classes/String.src/M000013.html +18 -0
- data/doc/created.rid +1 -0
- data/doc/files/lib/ruby_rhymes_rb.html +122 -0
- data/doc/files/lib/syllable_arrays_rb.html +101 -0
- data/doc/fr_class_index.html +30 -0
- data/doc/fr_file_index.html +28 -0
- data/doc/fr_method_index.html +39 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/ruby_rhymes.rb +8 -1
- metadata +29 -3
data/README.md
CHANGED
@@ -55,7 +55,7 @@ If you're not afraid of multiple pronunciations, you can call `.rhymes` instead
|
|
55
55
|
|
56
56
|
## Props
|
57
57
|
|
58
|
-
- [Thomas](https://github.com/thomas-kielbus, "github"), the co-author
|
58
|
+
- [Thomas](https://github.com/thomas-kielbus, "github"), the co-author extraordinaire
|
59
59
|
- The dictionaries, which is really what matters, came from [Brian Langenberger](http://rhyme.sourceforge.net/index.html "Rhyme Dictionary"), whose work was based on a [CMU Pronouncing Dictionary](http://www.speech.cs.cmu.edu/cgi-bin/cmudict CMU Dictionary).
|
60
60
|
- The syllable counter for words that aren't in the dictionary comes from the source made available by [Russell McVeigh](http://www.russellmcveigh.info/content/html/syllablecounter.php "PHP Syllable Counter"). I just ported the PHP.
|
61
61
|
|
data/README.rdoc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
test
|
@@ -0,0 +1,269 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Phrase</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Phrase</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/ruby_rhymes_rb.html">
|
59
|
+
lib/ruby_rhymes.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../files/lib/syllable_arrays_rb.html">
|
63
|
+
lib/syllable_arrays.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
</td>
|
67
|
+
</tr>
|
68
|
+
|
69
|
+
<tr class="top-aligned-row">
|
70
|
+
<td><strong>Parent:</strong></td>
|
71
|
+
<td>
|
72
|
+
Object
|
73
|
+
</td>
|
74
|
+
</tr>
|
75
|
+
</table>
|
76
|
+
</div>
|
77
|
+
<!-- banner header -->
|
78
|
+
|
79
|
+
<div id="bodyContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
<div id="contextContent">
|
84
|
+
|
85
|
+
<div id="description">
|
86
|
+
<p>
|
87
|
+
this class is the gateway to generating exciting poetry
|
88
|
+
</p>
|
89
|
+
|
90
|
+
</div>
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div id="method-list">
|
96
|
+
<h3 class="section-bar">Methods</h3>
|
97
|
+
|
98
|
+
<div class="name-list">
|
99
|
+
<a href="#M000005">dict?</a>
|
100
|
+
<a href="#M000007">flat_rhymes</a>
|
101
|
+
<a href="#M000001">new</a>
|
102
|
+
<a href="#M000003">rhyme_key</a>
|
103
|
+
<a href="#M000002">rhyme_keys</a>
|
104
|
+
<a href="#M000006">rhymes</a>
|
105
|
+
<a href="#M000004">syllables</a>
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
<!-- if includes -->
|
113
|
+
|
114
|
+
<div id="section">
|
115
|
+
|
116
|
+
<div id="class-list">
|
117
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
118
|
+
|
119
|
+
Class <a href="Phrase/Pronunciation.html" class="link">Phrase::Pronunciation</a><br />
|
120
|
+
Class <a href="Phrase/Pronunciations.html" class="link">Phrase::Pronunciations</a><br />
|
121
|
+
|
122
|
+
</div>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
<!-- if method_list -->
|
131
|
+
<div id="methods">
|
132
|
+
<h3 class="section-bar">Public Class methods</h3>
|
133
|
+
|
134
|
+
<div id="method-M000001" class="method-detail">
|
135
|
+
<a name="M000001"></a>
|
136
|
+
|
137
|
+
<div class="method-heading">
|
138
|
+
<a href="Phrase.src/M000001.html" target="Code" class="method-signature"
|
139
|
+
onclick="popupCode('Phrase.src/M000001.html');return false;">
|
140
|
+
<span class="method-name">new</span><span class="method-args">(phrase)</span>
|
141
|
+
</a>
|
142
|
+
</div>
|
143
|
+
|
144
|
+
<div class="method-description">
|
145
|
+
</div>
|
146
|
+
</div>
|
147
|
+
|
148
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
149
|
+
|
150
|
+
<div id="method-M000005" class="method-detail">
|
151
|
+
<a name="M000005"></a>
|
152
|
+
|
153
|
+
<div class="method-heading">
|
154
|
+
<a href="Phrase.src/M000005.html" target="Code" class="method-signature"
|
155
|
+
onclick="popupCode('Phrase.src/M000005.html');return false;">
|
156
|
+
<span class="method-name">dict?</span><span class="method-args">()</span>
|
157
|
+
</a>
|
158
|
+
</div>
|
159
|
+
|
160
|
+
<div class="method-description">
|
161
|
+
<p>
|
162
|
+
returns whether the last word in the phrase a dictionary word (useful to
|
163
|
+
know before calling <a href="Phrase.html#M000006">rhymes</a> and <a
|
164
|
+
href="Phrase.html#M000002">rhyme_keys</a>)
|
165
|
+
</p>
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<div id="method-M000007" class="method-detail">
|
170
|
+
<a name="M000007"></a>
|
171
|
+
|
172
|
+
<div class="method-heading">
|
173
|
+
<a href="Phrase.src/M000007.html" target="Code" class="method-signature"
|
174
|
+
onclick="popupCode('Phrase.src/M000007.html');return false;">
|
175
|
+
<span class="method-name">flat_rhymes</span><span class="method-args">()</span>
|
176
|
+
</a>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
<div class="method-description">
|
180
|
+
<p>
|
181
|
+
return a flat array of <a href="Phrase.html#M000006">rhymes</a>, rather
|
182
|
+
than by pronunciation
|
183
|
+
</p>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<div id="method-M000003" class="method-detail">
|
188
|
+
<a name="M000003"></a>
|
189
|
+
|
190
|
+
<div class="method-heading">
|
191
|
+
<a href="Phrase.src/M000003.html" target="Code" class="method-signature"
|
192
|
+
onclick="popupCode('Phrase.src/M000003.html');return false;">
|
193
|
+
<span class="method-name">rhyme_key</span><span class="method-args">()</span>
|
194
|
+
</a>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div class="method-description">
|
198
|
+
<p>
|
199
|
+
returns the first rhyme key or nil
|
200
|
+
</p>
|
201
|
+
</div>
|
202
|
+
</div>
|
203
|
+
|
204
|
+
<div id="method-M000002" class="method-detail">
|
205
|
+
<a name="M000002"></a>
|
206
|
+
|
207
|
+
<div class="method-heading">
|
208
|
+
<a href="Phrase.src/M000002.html" target="Code" class="method-signature"
|
209
|
+
onclick="popupCode('Phrase.src/M000002.html');return false;">
|
210
|
+
<span class="method-name">rhyme_keys</span><span class="method-args">()</span>
|
211
|
+
</a>
|
212
|
+
</div>
|
213
|
+
|
214
|
+
<div class="method-description">
|
215
|
+
<p>
|
216
|
+
returns the rhyme keys associated with this word (useful in matching with
|
217
|
+
other words to see if they rhyme)
|
218
|
+
</p>
|
219
|
+
</div>
|
220
|
+
</div>
|
221
|
+
|
222
|
+
<div id="method-M000006" class="method-detail">
|
223
|
+
<a name="M000006"></a>
|
224
|
+
|
225
|
+
<div class="method-heading">
|
226
|
+
<a href="Phrase.src/M000006.html" target="Code" class="method-signature"
|
227
|
+
onclick="popupCode('Phrase.src/M000006.html');return false;">
|
228
|
+
<span class="method-name">rhymes</span><span class="method-args">()</span>
|
229
|
+
</a>
|
230
|
+
</div>
|
231
|
+
|
232
|
+
<div class="method-description">
|
233
|
+
<p>
|
234
|
+
returns a map from rhyme key to a list of rhyming words in that key
|
235
|
+
</p>
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
<div id="method-M000004" class="method-detail">
|
240
|
+
<a name="M000004"></a>
|
241
|
+
|
242
|
+
<div class="method-heading">
|
243
|
+
<a href="Phrase.src/M000004.html" target="Code" class="method-signature"
|
244
|
+
onclick="popupCode('Phrase.src/M000004.html');return false;">
|
245
|
+
<span class="method-name">syllables</span><span class="method-args">()</span>
|
246
|
+
</a>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
<div class="method-description">
|
250
|
+
<p>
|
251
|
+
returns the number of <a href="Phrase.html#M000004">syllables</a> in the
|
252
|
+
phrase
|
253
|
+
</p>
|
254
|
+
</div>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
|
258
|
+
</div>
|
259
|
+
|
260
|
+
|
261
|
+
</div>
|
262
|
+
|
263
|
+
|
264
|
+
<div id="validator-badges">
|
265
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
266
|
+
</div>
|
267
|
+
|
268
|
+
</body>
|
269
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>new (Phrase)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/ruby_rhymes.rb, line 7</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">phrase</span>)
|
15
|
+
<span class="ruby-ivar">@phrase_tokens</span> = <span class="ruby-constant">Phrase</span>.<span class="ruby-identifier">clean_and_tokenize</span>(<span class="ruby-identifier">phrase</span>)
|
16
|
+
|
17
|
+
<span class="ruby-comment cmt"># [[p1a,p1b],[p2],p3]</span>
|
18
|
+
<span class="ruby-ivar">@pronunciations</span> = <span class="ruby-ivar">@phrase_tokens</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pt</span><span class="ruby-operator">|</span> <span class="ruby-constant">Pronunciations</span>.<span class="ruby-identifier">get_pronunciations</span>(<span class="ruby-identifier">pt</span>)} <span class="ruby-comment cmt">#pronunciation objects</span>
|
19
|
+
<span class="ruby-ivar">@last_word_pronunciation</span> = <span class="ruby-ivar">@pronunciations</span>.<span class="ruby-identifier">last</span>
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>rhyme_keys (Phrase)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/ruby_rhymes.rb, line 16</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rhyme_keys</span>
|
15
|
+
<span class="ruby-ivar">@last_word_pronunciation</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">:rhyme_key</span>).<span class="ruby-identifier">compact</span><span class="ruby-operator">||</span>[]
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>rhyme_key (Phrase)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/ruby_rhymes.rb, line 21</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rhyme_key</span>
|
15
|
+
<span class="ruby-identifier">rhyme_keys</span>.<span class="ruby-identifier">first</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>syllables (Phrase)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/ruby_rhymes.rb, line 26</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">syllables</span>
|
15
|
+
<span class="ruby-ivar">@pronunciations</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">num_syllables</span>}.<span class="ruby-identifier">inject</span>(<span class="ruby-identifier">:+</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>dict? (Phrase)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/ruby_rhymes.rb, line 31</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dict?</span>
|
15
|
+
<span class="ruby-ivar">@last_word_pronunciation</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">dict?</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>rhymes (Phrase)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/ruby_rhymes.rb, line 36</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rhymes</span>
|
15
|
+
<span class="ruby-ivar">@rhymes</span> = <span class="ruby-identifier">load_rhymes</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@rhymes</span>.<span class="ruby-identifier">nil?</span>
|
16
|
+
<span class="ruby-ivar">@rhymes</span>
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>flat_rhymes (Phrase)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/ruby_rhymes.rb, line 42</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flat_rhymes</span>
|
15
|
+
<span class="ruby-identifier">rhymes</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span>[] <span class="ruby-operator">:</span> <span class="ruby-ivar">@rhymes</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">flatten</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,206 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Phrase::Pronunciation</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Phrase::Pronunciation</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/ruby_rhymes_rb.html">
|
59
|
+
lib/ruby_rhymes.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
a container of word, pronunciation_id, num_syllables, and rhyme_key
|
84
|
+
</p>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div id="method-list">
|
92
|
+
<h3 class="section-bar">Methods</h3>
|
93
|
+
|
94
|
+
<div class="name-list">
|
95
|
+
<a href="#M000011">dict?</a>
|
96
|
+
<a href="#M000010">new</a>
|
97
|
+
<a href="#M000012">to_s</a>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
<!-- if includes -->
|
105
|
+
|
106
|
+
<div id="section">
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<div id="attribute-list">
|
113
|
+
<h3 class="section-bar">Attributes</h3>
|
114
|
+
|
115
|
+
<div class="name-list">
|
116
|
+
<table>
|
117
|
+
<tr class="top-aligned-row context-row">
|
118
|
+
<td class="context-item-name">num_syllables</td>
|
119
|
+
<td class="context-item-value"> [R] </td>
|
120
|
+
<td class="context-item-desc"></td>
|
121
|
+
</tr>
|
122
|
+
<tr class="top-aligned-row context-row">
|
123
|
+
<td class="context-item-name">pronunciation_id</td>
|
124
|
+
<td class="context-item-value"> [R] </td>
|
125
|
+
<td class="context-item-desc"></td>
|
126
|
+
</tr>
|
127
|
+
<tr class="top-aligned-row context-row">
|
128
|
+
<td class="context-item-name">rhyme_key</td>
|
129
|
+
<td class="context-item-value"> [R] </td>
|
130
|
+
<td class="context-item-desc"></td>
|
131
|
+
</tr>
|
132
|
+
<tr class="top-aligned-row context-row">
|
133
|
+
<td class="context-item-name">word</td>
|
134
|
+
<td class="context-item-value"> [R] </td>
|
135
|
+
<td class="context-item-desc"></td>
|
136
|
+
</tr>
|
137
|
+
</table>
|
138
|
+
</div>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
<!-- if method_list -->
|
144
|
+
<div id="methods">
|
145
|
+
<h3 class="section-bar">Public Class methods</h3>
|
146
|
+
|
147
|
+
<div id="method-M000010" class="method-detail">
|
148
|
+
<a name="M000010"></a>
|
149
|
+
|
150
|
+
<div class="method-heading">
|
151
|
+
<a href="Pronunciation.src/M000010.html" target="Code" class="method-signature"
|
152
|
+
onclick="popupCode('Pronunciation.src/M000010.html');return false;">
|
153
|
+
<span class="method-name">new</span><span class="method-args">(word, pronunciation_id, num_syllables, rhyme_key)</span>
|
154
|
+
</a>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
<div class="method-description">
|
158
|
+
</div>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
162
|
+
|
163
|
+
<div id="method-M000011" class="method-detail">
|
164
|
+
<a name="M000011"></a>
|
165
|
+
|
166
|
+
<div class="method-heading">
|
167
|
+
<a href="Pronunciation.src/M000011.html" target="Code" class="method-signature"
|
168
|
+
onclick="popupCode('Pronunciation.src/M000011.html');return false;">
|
169
|
+
<span class="method-name">dict?</span><span class="method-args">()</span>
|
170
|
+
</a>
|
171
|
+
</div>
|
172
|
+
|
173
|
+
<div class="method-description">
|
174
|
+
<p>
|
175
|
+
dictionary word?
|
176
|
+
</p>
|
177
|
+
</div>
|
178
|
+
</div>
|
179
|
+
|
180
|
+
<div id="method-M000012" class="method-detail">
|
181
|
+
<a name="M000012"></a>
|
182
|
+
|
183
|
+
<div class="method-heading">
|
184
|
+
<a href="Pronunciation.src/M000012.html" target="Code" class="method-signature"
|
185
|
+
onclick="popupCode('Pronunciation.src/M000012.html');return false;">
|
186
|
+
<span class="method-name">to_s</span><span class="method-args">()</span>
|
187
|
+
</a>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
<div class="method-description">
|
191
|
+
</div>
|
192
|
+
</div>
|
193
|
+
|
194
|
+
|
195
|
+
</div>
|
196
|
+
|
197
|
+
|
198
|
+
</div>
|
199
|
+
|
200
|
+
|
201
|
+
<div id="validator-badges">
|
202
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
</body>
|
206
|
+
</html>
|