wwwjdic 13.0.1 → 16.1.0
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/CHANGELOG +60 -1
- data/Gemfile +7 -1
- data/README.md +500 -225
- data/Rakefile +10 -3
- data/copyright.md +17 -29
- data/examples/basics.rb +53 -45
- data/examples/translate.rb +159 -86
- data/examples/uri.rb +46 -78
- data/html/CHANGELOG.html +90 -35
- data/html/COPYING_md.html +26 -38
- data/html/Gemfile.html +25 -35
- data/html/Object.html +838 -74
- data/html/README_md.html +322 -175
- data/html/Rakefile.html +28 -38
- data/html/WWWJDic.html +63 -104
- data/html/WWWJDic/ParsableDuckType.html +38 -58
- data/html/WWWJDic/Parser.html +52 -92
- data/html/WWWJDic/Parsers.html +29 -35
- data/html/WWWJDic/Parsers/Dict.html +50 -76
- data/html/WWWJDic/Parsers/Display.html +45 -69
- data/html/WWWJDic/Parsers/Key.html +46 -70
- data/html/WWWJDic/Parsers/Search.html +41 -61
- data/html/WWWJDic/Parsers/Server.html +45 -69
- data/html/WWWJDic/Splitter.html +81 -175
- data/html/WWWJDic/Utils.html +30 -36
- data/html/WWWJDic/Utils/Downloader.html +41 -41
- data/html/WWWJDic/Utils/Downloader/Downloader.html +65 -92
- data/html/WWWJDic/Utils/Raisers.html +46 -98
- data/html/WWWJDic/WWWJDic.html +166 -348
- data/html/copyright_md.html +219 -239
- data/html/created.rid +33 -58
- data/html/css/rdoc.css +638 -590
- data/html/index.html +313 -182
- data/html/js/darkfish.js +84 -161
- data/html/js/navigation.js +4 -40
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +109 -109
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +228 -229
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +161 -200
- data/lib/wwwjdic.rb +14 -15
- data/lib/wwwjdic/application.rb +68 -36
- data/lib/wwwjdic/constants.rb +56 -12
- data/lib/wwwjdic/locales/de.yml +9 -4
- data/lib/wwwjdic/locales/en.yml +9 -4
- data/lib/wwwjdic/locales/es.yml +9 -4
- data/lib/wwwjdic/locales/fr.yml +9 -4
- data/lib/wwwjdic/locales/hu.yml +9 -4
- data/lib/wwwjdic/locales/it.yml +9 -4
- data/lib/wwwjdic/locales/ja.yml +11 -5
- data/lib/wwwjdic/locales/nl.yml +9 -4
- data/lib/wwwjdic/locales/ru.yml +9 -4
- data/lib/wwwjdic/locales/sl.yml +9 -4
- data/lib/wwwjdic/locales/sv.yml +9 -4
- data/lib/wwwjdic/parser.rb +13 -8
- data/lib/wwwjdic/parsers/dict.rb +11 -8
- data/lib/wwwjdic/parsers/display.rb +8 -3
- data/lib/wwwjdic/parsers/key.rb +9 -3
- data/lib/wwwjdic/parsers/search.rb +10 -3
- data/lib/wwwjdic/parsers/server.rb +8 -3
- data/lib/wwwjdic/utils/downloader.rb +37 -34
- data/lib/wwwjdic/utils/raisers.rb +12 -15
- data/lib/wwwjdic/utils/splitter.rb +32 -18
- data/lib/wwwjdic/version.rb +22 -8
- data/test/test_helper.rb +10 -1
- data/test/test_wwwjdic.rb +10 -4
- data/test/wwwjdic/locales/de.yml +9 -1
- data/test/wwwjdic/locales/en.yml +9 -1
- data/test/wwwjdic/locales/es.yml +9 -1
- data/test/wwwjdic/locales/fr.yml +9 -1
- data/test/wwwjdic/locales/hu.yml +9 -1
- data/test/wwwjdic/locales/it.yml +10 -1
- data/test/wwwjdic/locales/ja.yml +11 -2
- data/test/wwwjdic/locales/nl.yml +9 -1
- data/test/wwwjdic/locales/ru.yml +9 -1
- data/test/wwwjdic/locales/sl.yml +9 -1
- data/test/wwwjdic/locales/sv.yml +9 -1
- data/test/wwwjdic/locales/test_locales.rb +41 -24
- data/test/wwwjdic/parsers/test_dict.rb +65 -37
- data/test/wwwjdic/parsers/test_display.rb +11 -5
- data/test/wwwjdic/parsers/test_key.rb +10 -4
- data/test/wwwjdic/parsers/test_server.rb +11 -5
- data/test/wwwjdic/test_application.rb +199 -149
- data/test/wwwjdic/test_parsable_duck_type.rb +9 -5
- data/test/wwwjdic/utils/test_downloader.rb +7 -1
- data/test/wwwjdic/utils/test_raisers.rb +46 -29
- data/wwwjdic.gemspec +44 -26
- metadata +55 -43
- data/acknowledgements.md +0 -55
- data/authors.md +0 -67
- data/html/acknowledgements_md.html +0 -149
- data/html/authors_md.html +0 -181
- data/html/js/jquery.js +0 -4
- data/html/wwwjdic_gemspec.html +0 -161
data/html/WWWJDic/Parser.html
CHANGED
@@ -4,26 +4,27 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<title>class WWWJDic::Parser - wwwjdic
|
7
|
+
<title>class WWWJDic::Parser - wwwjdic 16.1.0</title>
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
11
|
var index_rel_prefix = "../";
|
12
12
|
</script>
|
13
13
|
|
14
|
-
<script src="../js/
|
15
|
-
<script src="../js/
|
14
|
+
<script defer src="../js/navigation.js"></script>
|
15
|
+
<script defer src="../js/search.js"></script>
|
16
|
+
<script defer src="../js/search_index.js"></script>
|
17
|
+
<script defer src="../js/searcher.js"></script>
|
18
|
+
<script defer src="../js/darkfish.js"></script>
|
16
19
|
|
17
20
|
<link href="../css/fonts.css" rel="stylesheet">
|
18
21
|
<link href="../css/rdoc.css" rel="stylesheet">
|
19
22
|
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
<body id="top" role="document" class="class">
|
24
|
+
<body class="class" id="top" role="document">
|
24
25
|
<nav role="navigation">
|
25
26
|
<div id="project-navigation">
|
26
|
-
<div id="home-section" role="region" title="Quick navigation"
|
27
|
+
<div class="nav-section" id="home-section" role="region" title="Quick navigation">
|
27
28
|
<h2>
|
28
29
|
<a href="../index.html" rel="home">Home</a>
|
29
30
|
</h2>
|
@@ -35,67 +36,64 @@
|
|
35
36
|
</div>
|
36
37
|
</div>
|
37
38
|
|
38
|
-
<div
|
39
|
-
<form action="#" method="get"
|
39
|
+
<div class="project-section initially-hidden" id="search-section" role="search">
|
40
|
+
<form accept-charset="utf-8" action="#" method="get">
|
40
41
|
<div id="search-field-wrapper">
|
41
|
-
<input
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
<input aria-autocomplete="list" aria-controls="search-results" aria-label="Search"
|
43
|
+
id="search-field" name="search"
|
44
|
+
placeholder="Search" role="combobox" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"
|
45
|
+
type="text">
|
45
46
|
</div>
|
46
47
|
|
47
|
-
<ul
|
48
|
-
aria-
|
49
|
-
|
48
|
+
<ul aria-atomic="false" aria-busy="false"
|
49
|
+
aria-expanded="false" aria-label="Search Results"
|
50
|
+
class="initially-hidden" id="search-results"></ul>
|
50
51
|
</form>
|
51
52
|
</div>
|
52
53
|
|
53
54
|
</div>
|
54
55
|
|
55
|
-
|
56
|
+
|
56
57
|
|
57
58
|
<div id="class-metadata">
|
58
|
-
|
59
|
-
|
59
|
+
|
60
|
+
|
61
|
+
<div class="nav-section" id="parent-class-section">
|
60
62
|
<h3>Parent</h3>
|
61
63
|
|
62
|
-
|
63
64
|
<p class="link"><a href="../Object.html">Object</a>
|
64
|
-
|
65
65
|
</div>
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div class="nav-section" id="method-list-section">
|
71
72
|
<h3>Methods</h3>
|
72
73
|
|
73
74
|
<ul class="link-list" role="directory">
|
74
|
-
|
75
75
|
<li ><a href="#method-c-new">::new</a>
|
76
|
-
|
77
76
|
<li ><a href="#method-i-parse">#parse</a>
|
78
|
-
|
79
77
|
</ul>
|
80
78
|
</div>
|
81
79
|
|
82
80
|
</div>
|
83
81
|
</nav>
|
84
82
|
|
85
|
-
<main
|
86
|
-
<h1 id="class-WWWJDic::Parser"
|
83
|
+
<main aria-labelledby="class-WWWJDic::Parser" role="main">
|
84
|
+
<h1 class="class" id="class-WWWJDic::Parser">
|
87
85
|
class WWWJDic::Parser
|
88
86
|
</h1>
|
89
87
|
|
90
88
|
<section class="description">
|
91
|
-
|
89
|
+
|
92
90
|
<p>This class is a simple utility that is used to <a href="Parser.html#method-i-parse"><code>parse</code></a> and filter parameters for wwwjdic.</p>
|
93
91
|
<dl class="rdoc-list note-list"><dt>Author
|
94
92
|
<dd>
|
95
93
|
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
96
94
|
</dd><dt>Copyright
|
97
95
|
<dd>
|
98
|
-
<p
|
96
|
+
<p>© 2014-2021 Marco Bresciani</p>
|
99
97
|
</dd><dt>License
|
100
98
|
<dd>
|
101
99
|
<p>GNU General Public License version 3</p>
|
@@ -103,131 +101,93 @@
|
|
103
101
|
|
104
102
|
</section>
|
105
103
|
|
106
|
-
|
107
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
108
|
-
|
104
|
+
<section class="documentation-section" id="5Buntitled-5D">
|
109
105
|
|
110
|
-
|
111
106
|
|
112
|
-
|
113
107
|
|
114
|
-
|
115
108
|
<section class="attribute-method-details" class="method-section">
|
116
109
|
<header>
|
117
110
|
<h3>Attributes</h3>
|
118
111
|
</header>
|
119
112
|
|
120
|
-
|
121
|
-
<div id="attribute-i-parsers" class="method-detail">
|
113
|
+
<div class="method-detail" id="attribute-i-parsers">
|
122
114
|
<div class="method-heading attribute-method-heading">
|
123
115
|
<span class="method-name">parsers</span><span
|
124
116
|
class="attribute-access-type">[R]</span>
|
125
117
|
</div>
|
126
118
|
|
127
119
|
<div class="method-description">
|
128
|
-
|
129
|
-
|
130
|
-
|
120
|
+
|
131
121
|
</div>
|
132
122
|
</div>
|
133
|
-
|
134
123
|
</section>
|
135
|
-
|
136
124
|
|
137
|
-
|
138
|
-
<section id="public-class-5Buntitled-5D-method-details"
|
125
|
+
|
126
|
+
<section class="method-section" id="public-class-5Buntitled-5D-method-details">
|
139
127
|
<header>
|
140
128
|
<h3>Public Class Methods</h3>
|
141
129
|
</header>
|
142
130
|
|
143
|
-
|
144
|
-
<div id="method-c-new" class="method-detail ">
|
145
|
-
|
131
|
+
<div class="method-detail " id="method-c-new">
|
146
132
|
<div class="method-heading">
|
147
133
|
<span class="method-name">new</span><span
|
148
134
|
class="method-args">(args = {})</span>
|
149
|
-
|
150
135
|
<span class="method-click-advice">click to toggle source</span>
|
151
|
-
|
152
136
|
</div>
|
153
|
-
|
154
137
|
|
155
138
|
<div class="method-description">
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
139
|
|
161
|
-
|
140
|
+
|
162
141
|
<div class="method-source-code" id="new-source">
|
163
142
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/parser.rb</span>
|
164
|
-
<span class="line-num">
|
165
|
-
<span class="line-num">
|
166
|
-
<span class="line-num">
|
167
|
-
<span class="line-num">
|
143
|
+
<span class="line-num">39</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">args</span> = {})
|
144
|
+
<span class="line-num">40</span> <span class="ruby-ivar">@parsers</span> = {}
|
145
|
+
<span class="line-num">41</span> <span class="ruby-constant">ALL_PARAMS</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">param</span><span class="ruby-operator">|</span> <span class="ruby-identifier">parsers</span>[<span class="ruby-identifier">param</span>] = <span class="ruby-identifier">args</span>[<span class="ruby-identifier">param</span>] } <span class="ruby-keyword">unless</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">nil?</span>
|
146
|
+
<span class="line-num">42</span> <span class="ruby-keyword">end</span></pre>
|
168
147
|
</div>
|
169
|
-
|
170
148
|
</div>
|
171
149
|
|
172
|
-
|
173
150
|
|
174
|
-
|
175
151
|
</div>
|
176
152
|
|
177
|
-
|
178
153
|
</section>
|
179
|
-
|
180
|
-
<section id="public-instance-5Buntitled-5D-method-details"
|
154
|
+
|
155
|
+
<section class="method-section" id="public-instance-5Buntitled-5D-method-details">
|
181
156
|
<header>
|
182
157
|
<h3>Public Instance Methods</h3>
|
183
158
|
</header>
|
184
159
|
|
185
|
-
|
186
|
-
<div id="method-i-parse" class="method-detail ">
|
187
|
-
|
160
|
+
<div class="method-detail " id="method-i-parse">
|
188
161
|
<div class="method-heading">
|
189
162
|
<span class="method-name">parse</span><span
|
190
|
-
class="method-args">(method = nil,
|
191
|
-
|
163
|
+
class="method-args">(method = nil, params = nil)</span>
|
192
164
|
<span class="method-click-advice">click to toggle source</span>
|
193
|
-
|
194
165
|
</div>
|
195
|
-
|
196
166
|
|
197
167
|
<div class="method-description">
|
198
|
-
|
199
168
|
<p>Provides the duck type for a generic parsing object.</p>
|
200
|
-
|
201
|
-
|
202
169
|
|
203
|
-
|
204
170
|
<div class="method-source-code" id="parse-source">
|
205
171
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/parser.rb</span>
|
206
|
-
<span class="line-num">
|
207
|
-
<span class="line-num">
|
208
|
-
<span class="line-num">
|
209
|
-
<span class="line-num">
|
210
|
-
<span class="line-num">
|
172
|
+
<span class="line-num">45</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse</span>(<span class="ruby-identifier">method</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">params</span> = <span class="ruby-keyword">nil</span>)
|
173
|
+
<span class="line-num">46</span> <span class="ruby-identifier">a_parser</span> = <span class="ruby-keyword">nil</span>
|
174
|
+
<span class="line-num">47</span> <span class="ruby-identifier">a_parser</span> = <span class="ruby-identifier">parsers</span>[<span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_sym</span>] <span class="ruby-keyword">unless</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">parsers</span>.<span class="ruby-identifier">nil?</span>
|
175
|
+
<span class="line-num">48</span> <span class="ruby-identifier">a_parser</span>&.<span class="ruby-identifier">parse</span> <span class="ruby-identifier">params</span>
|
176
|
+
<span class="line-num">49</span> <span class="ruby-keyword">end</span></pre>
|
211
177
|
</div>
|
212
|
-
|
213
178
|
</div>
|
214
179
|
|
215
|
-
|
216
180
|
|
217
|
-
|
218
181
|
</div>
|
219
182
|
|
220
|
-
|
221
183
|
</section>
|
222
|
-
|
223
|
-
</section>
|
224
184
|
|
185
|
+
</section>
|
225
186
|
</main>
|
226
187
|
|
227
188
|
|
228
189
|
<footer id="validator-badges" role="contentinfo">
|
229
190
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
230
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
191
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.2.
|
231
192
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
232
193
|
</footer>
|
233
|
-
|
data/html/WWWJDic/Parsers.html
CHANGED
@@ -4,26 +4,27 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<title>module WWWJDic::Parsers - wwwjdic
|
7
|
+
<title>module WWWJDic::Parsers - wwwjdic 16.1.0</title>
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../";
|
11
11
|
var index_rel_prefix = "../";
|
12
12
|
</script>
|
13
13
|
|
14
|
-
<script src="../js/
|
15
|
-
<script src="../js/
|
14
|
+
<script defer src="../js/navigation.js"></script>
|
15
|
+
<script defer src="../js/search.js"></script>
|
16
|
+
<script defer src="../js/search_index.js"></script>
|
17
|
+
<script defer src="../js/searcher.js"></script>
|
18
|
+
<script defer src="../js/darkfish.js"></script>
|
16
19
|
|
17
20
|
<link href="../css/fonts.css" rel="stylesheet">
|
18
21
|
<link href="../css/rdoc.css" rel="stylesheet">
|
19
22
|
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
<body id="top" role="document" class="module">
|
24
|
+
<body class="module" id="top" role="document">
|
24
25
|
<nav role="navigation">
|
25
26
|
<div id="project-navigation">
|
26
|
-
<div id="home-section" role="region" title="Quick navigation"
|
27
|
+
<div class="nav-section" id="home-section" role="region" title="Quick navigation">
|
27
28
|
<h2>
|
28
29
|
<a href="../index.html" rel="home">Home</a>
|
29
30
|
</h2>
|
@@ -35,62 +36,55 @@
|
|
35
36
|
</div>
|
36
37
|
</div>
|
37
38
|
|
38
|
-
<div
|
39
|
-
<form action="#" method="get"
|
39
|
+
<div class="project-section initially-hidden" id="search-section" role="search">
|
40
|
+
<form accept-charset="utf-8" action="#" method="get">
|
40
41
|
<div id="search-field-wrapper">
|
41
|
-
<input
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
<input aria-autocomplete="list" aria-controls="search-results" aria-label="Search"
|
43
|
+
id="search-field" name="search"
|
44
|
+
placeholder="Search" role="combobox" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"
|
45
|
+
type="text">
|
45
46
|
</div>
|
46
47
|
|
47
|
-
<ul
|
48
|
-
aria-
|
49
|
-
|
48
|
+
<ul aria-atomic="false" aria-busy="false"
|
49
|
+
aria-expanded="false" aria-label="Search Results"
|
50
|
+
class="initially-hidden" id="search-results"></ul>
|
50
51
|
</form>
|
51
52
|
</div>
|
52
53
|
|
53
54
|
</div>
|
54
55
|
|
55
|
-
|
56
|
+
|
56
57
|
|
57
58
|
<div id="class-metadata">
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
63
64
|
</div>
|
64
65
|
</nav>
|
65
66
|
|
66
|
-
<main
|
67
|
-
<h1 id="module-WWWJDic::Parsers"
|
67
|
+
<main aria-labelledby="module-WWWJDic::Parsers" role="main">
|
68
|
+
<h1 class="module" id="module-WWWJDic::Parsers">
|
68
69
|
module WWWJDic::Parsers
|
69
70
|
</h1>
|
70
71
|
|
71
72
|
<section class="description">
|
72
|
-
|
73
|
+
|
73
74
|
</section>
|
74
75
|
|
75
|
-
|
76
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
77
|
-
|
76
|
+
<section class="documentation-section" id="5Buntitled-5D">
|
78
77
|
|
79
|
-
|
80
78
|
|
81
|
-
|
82
79
|
|
83
|
-
|
84
80
|
|
85
|
-
|
86
|
-
</section>
|
87
81
|
|
82
|
+
</section>
|
88
83
|
</main>
|
89
84
|
|
90
85
|
|
91
86
|
<footer id="validator-badges" role="contentinfo">
|
92
87
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
93
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
88
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.2.
|
94
89
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
95
90
|
</footer>
|
96
|
-
|
@@ -4,26 +4,27 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
|
7
|
-
<title>class WWWJDic::Parsers::Dict - wwwjdic
|
7
|
+
<title>class WWWJDic::Parsers::Dict - wwwjdic 16.1.0</title>
|
8
8
|
|
9
9
|
<script type="text/javascript">
|
10
10
|
var rdoc_rel_prefix = "../../";
|
11
11
|
var index_rel_prefix = "../../";
|
12
12
|
</script>
|
13
13
|
|
14
|
-
<script src="../../js/
|
15
|
-
<script src="../../js/
|
14
|
+
<script defer src="../../js/navigation.js"></script>
|
15
|
+
<script defer src="../../js/search.js"></script>
|
16
|
+
<script defer src="../../js/search_index.js"></script>
|
17
|
+
<script defer src="../../js/searcher.js"></script>
|
18
|
+
<script defer src="../../js/darkfish.js"></script>
|
16
19
|
|
17
20
|
<link href="../../css/fonts.css" rel="stylesheet">
|
18
21
|
<link href="../../css/rdoc.css" rel="stylesheet">
|
19
22
|
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
<body id="top" role="document" class="class">
|
24
|
+
<body class="class" id="top" role="document">
|
24
25
|
<nav role="navigation">
|
25
26
|
<div id="project-navigation">
|
26
|
-
<div id="home-section" role="region" title="Quick navigation"
|
27
|
+
<div class="nav-section" id="home-section" role="region" title="Quick navigation">
|
27
28
|
<h2>
|
28
29
|
<a href="../../index.html" rel="home">Home</a>
|
29
30
|
</h2>
|
@@ -35,69 +36,64 @@
|
|
35
36
|
</div>
|
36
37
|
</div>
|
37
38
|
|
38
|
-
<div
|
39
|
-
<form action="#" method="get"
|
39
|
+
<div class="project-section initially-hidden" id="search-section" role="search">
|
40
|
+
<form accept-charset="utf-8" action="#" method="get">
|
40
41
|
<div id="search-field-wrapper">
|
41
|
-
<input
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
<input aria-autocomplete="list" aria-controls="search-results" aria-label="Search"
|
43
|
+
id="search-field" name="search"
|
44
|
+
placeholder="Search" role="combobox" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"
|
45
|
+
type="text">
|
45
46
|
</div>
|
46
47
|
|
47
|
-
<ul
|
48
|
-
aria-
|
49
|
-
|
48
|
+
<ul aria-atomic="false" aria-busy="false"
|
49
|
+
aria-expanded="false" aria-label="Search Results"
|
50
|
+
class="initially-hidden" id="search-results"></ul>
|
50
51
|
</form>
|
51
52
|
</div>
|
52
53
|
|
53
54
|
</div>
|
54
55
|
|
55
|
-
|
56
|
+
|
56
57
|
|
57
58
|
<div id="class-metadata">
|
58
|
-
|
59
|
-
|
59
|
+
|
60
|
+
|
61
|
+
<div class="nav-section" id="parent-class-section">
|
60
62
|
<h3>Parent</h3>
|
61
63
|
|
62
|
-
|
63
64
|
<p class="link"><a href="../../Object.html">Object</a>
|
64
|
-
|
65
65
|
</div>
|
66
66
|
|
67
|
-
|
67
|
+
|
68
|
+
<div class="nav-section" id="includes-section">
|
68
69
|
<h3>Included Modules</h3>
|
69
70
|
|
70
71
|
<ul class="link-list">
|
71
|
-
|
72
|
-
|
73
72
|
<li><a class="include" href="../Utils/Raisers.html">WWWJDic::Utils::Raisers</a>
|
74
|
-
|
75
|
-
|
76
73
|
</ul>
|
77
74
|
</div>
|
78
75
|
|
79
|
-
|
80
|
-
|
81
|
-
|
76
|
+
|
77
|
+
|
78
|
+
<!-- Method Quickref -->
|
79
|
+
<div class="nav-section" id="method-list-section">
|
82
80
|
<h3>Methods</h3>
|
83
81
|
|
84
82
|
<ul class="link-list" role="directory">
|
85
|
-
|
86
83
|
<li ><a href="#method-i-parse">#parse</a>
|
87
|
-
|
88
84
|
</ul>
|
89
85
|
</div>
|
90
86
|
|
91
87
|
</div>
|
92
88
|
</nav>
|
93
89
|
|
94
|
-
<main
|
95
|
-
<h1 id="class-WWWJDic::Parsers::Dict"
|
90
|
+
<main aria-labelledby="class-WWWJDic::Parsers::Dict" role="main">
|
91
|
+
<h1 class="class" id="class-WWWJDic::Parsers::Dict">
|
96
92
|
class WWWJDic::Parsers::Dict
|
97
93
|
</h1>
|
98
94
|
|
99
95
|
<section class="description">
|
100
|
-
|
96
|
+
|
101
97
|
<p>This class is an implementation of the Parsable duck type that checks the dictionary type. The only needed parameter is a valid dictionary.</p>
|
102
98
|
|
103
99
|
<p>n = dictionary to use (1 = EDICT, 3 = ENAMDICT, etc. Examine the source of one of the pages to get the full list of codes.)</p>
|
@@ -106,7 +102,7 @@
|
|
106
102
|
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
107
103
|
</dd><dt>Copyright
|
108
104
|
<dd>
|
109
|
-
<p
|
105
|
+
<p>© 2014-2021 Marco Bresciani</p>
|
110
106
|
</dd><dt>License
|
111
107
|
<dd>
|
112
108
|
<p>GNU General Public License version 3</p>
|
@@ -114,78 +110,56 @@
|
|
114
110
|
|
115
111
|
</section>
|
116
112
|
|
117
|
-
|
118
|
-
|
119
|
-
|
113
|
+
<section class="documentation-section" id="5Buntitled-5D">
|
114
|
+
|
120
115
|
|
121
|
-
|
122
116
|
|
123
|
-
|
124
117
|
|
125
|
-
|
126
118
|
|
127
|
-
|
128
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
119
|
+
<section class="method-section" id="public-instance-5Buntitled-5D-method-details">
|
129
120
|
<header>
|
130
121
|
<h3>Public Instance Methods</h3>
|
131
122
|
</header>
|
132
123
|
|
133
|
-
|
134
|
-
<div id="method-i-parse" class="method-detail ">
|
135
|
-
|
124
|
+
<div class="method-detail " id="method-i-parse">
|
136
125
|
<div class="method-heading">
|
137
126
|
<span class="method-name">parse</span><span
|
138
127
|
class="method-args">(value = '1')</span>
|
139
|
-
|
140
128
|
<span class="method-click-advice">click to toggle source</span>
|
141
|
-
|
142
129
|
</div>
|
143
|
-
|
144
130
|
|
145
131
|
<div class="method-description">
|
146
|
-
|
147
132
|
<p>The parsable duck type interface to every parser usage.</p>
|
148
|
-
|
149
|
-
|
150
133
|
|
151
|
-
|
152
134
|
<div class="method-source-code" id="parse-source">
|
153
135
|
<pre> <span class="ruby-comment"># File lib/wwwjdic/parsers/dict.rb</span>
|
154
|
-
<span class="line-num">
|
155
|
-
<span class="line-num">
|
156
|
-
<span class="line-num">
|
157
|
-
<span class="line-num">
|
158
|
-
<span class="line-num">
|
159
|
-
<span class="line-num">
|
160
|
-
<span class="line-num">
|
161
|
-
<span class="line-num">
|
162
|
-
<span class="line-num">
|
163
|
-
<span class="line-num">
|
164
|
-
<span class="line-num">
|
165
|
-
<span class="line-num">
|
166
|
-
<span class="line-num">
|
167
|
-
<span class="line-num">54</span> <span class="ruby-keyword">end</span>
|
168
|
-
<span class="line-num">55</span> <span class="ruby-keyword">end</span></pre>
|
136
|
+
<span class="line-num">46</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse</span>(<span class="ruby-identifier">value</span> = <span class="ruby-string">'1'</span>)
|
137
|
+
<span class="line-num">47</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.nil'</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
|
138
|
+
<span class="line-num">48</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.param'</span>, <span class="ruby-value">value:</span> <span class="ruby-identifier">value</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:length</span>
|
139
|
+
<span class="line-num">49</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.param'</span>, <span class="ruby-value">value:</span> <span class="ruby-identifier">value</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">empty?</span>
|
140
|
+
<span class="line-num">50</span>
|
141
|
+
<span class="line-num">51</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
142
|
+
<span class="line-num">52</span> <span class="ruby-identifier">raiser_array</span>(<span class="ruby-string">'error.param'</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">DICTIONARY_CODES</span>)
|
143
|
+
<span class="line-num">53</span> <span class="ruby-identifier">value</span>
|
144
|
+
<span class="line-num">54</span> <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span>
|
145
|
+
<span class="line-num">55</span> <span class="ruby-identifier">raiser_array</span>(<span class="ruby-string">'error.param'</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">DICTIONARY_NAMES</span>)
|
146
|
+
<span class="line-num">56</span> <span class="ruby-constant">DICTS_BY_NAMES</span>[<span class="ruby-identifier">value</span>]
|
147
|
+
<span class="line-num">57</span> <span class="ruby-keyword">end</span>
|
148
|
+
<span class="line-num">58</span> <span class="ruby-keyword">end</span></pre>
|
169
149
|
</div>
|
170
|
-
|
171
150
|
</div>
|
172
151
|
|
173
|
-
|
174
152
|
|
175
|
-
|
176
153
|
</div>
|
177
154
|
|
178
|
-
|
179
155
|
</section>
|
180
|
-
|
181
|
-
</section>
|
182
156
|
|
157
|
+
</section>
|
183
158
|
</main>
|
184
159
|
|
185
160
|
|
186
161
|
<footer id="validator-badges" role="contentinfo">
|
187
162
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
188
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
163
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.2.
|
189
164
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
190
165
|
</footer>
|
191
|
-
|