wwwjdic 13.0.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.
Files changed (130) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +419 -0
  3. data/COPYING.md +675 -0
  4. data/Gemfile +21 -0
  5. data/README.md +303 -0
  6. data/Rakefile +52 -0
  7. data/acknowledgements.md +55 -0
  8. data/authors.md +67 -0
  9. data/copyright.md +377 -0
  10. data/examples/basics.rb +117 -0
  11. data/examples/translate.rb +128 -0
  12. data/examples/uri.rb +129 -0
  13. data/html/CHANGELOG.html +597 -0
  14. data/html/COPYING_md.html +389 -0
  15. data/html/Gemfile.html +104 -0
  16. data/html/Object.html +185 -0
  17. data/html/README_md.html +343 -0
  18. data/html/Rakefile.html +137 -0
  19. data/html/WWWJDic/ParsableDuckType.html +159 -0
  20. data/html/WWWJDic/Parser.html +233 -0
  21. data/html/WWWJDic/Parsers/Dict.html +191 -0
  22. data/html/WWWJDic/Parsers/Display.html +184 -0
  23. data/html/WWWJDic/Parsers/Key.html +221 -0
  24. data/html/WWWJDic/Parsers/Search.html +214 -0
  25. data/html/WWWJDic/Parsers/Server.html +182 -0
  26. data/html/WWWJDic/Parsers.html +96 -0
  27. data/html/WWWJDic/Splitter.html +378 -0
  28. data/html/WWWJDic/Utils/Downloader/Downloader.html +227 -0
  29. data/html/WWWJDic/Utils/Downloader.html +108 -0
  30. data/html/WWWJDic/Utils/Raisers.html +235 -0
  31. data/html/WWWJDic/Utils.html +108 -0
  32. data/html/WWWJDic/WWWJDic.html +715 -0
  33. data/html/WWWJDic.html +348 -0
  34. data/html/acknowledgements_md.html +149 -0
  35. data/html/authors_md.html +181 -0
  36. data/html/copyright_md.html +422 -0
  37. data/html/created.rid +59 -0
  38. data/html/css/fonts.css +167 -0
  39. data/html/css/rdoc.css +590 -0
  40. data/html/fonts/Lato-Light.ttf +0 -0
  41. data/html/fonts/Lato-LightItalic.ttf +0 -0
  42. data/html/fonts/Lato-Regular.ttf +0 -0
  43. data/html/fonts/Lato-RegularItalic.ttf +0 -0
  44. data/html/fonts/SourceCodePro-Bold.ttf +0 -0
  45. data/html/fonts/SourceCodePro-Regular.ttf +0 -0
  46. data/html/images/add.png +0 -0
  47. data/html/images/arrow_up.png +0 -0
  48. data/html/images/brick.png +0 -0
  49. data/html/images/brick_link.png +0 -0
  50. data/html/images/bug.png +0 -0
  51. data/html/images/bullet_black.png +0 -0
  52. data/html/images/bullet_toggle_minus.png +0 -0
  53. data/html/images/bullet_toggle_plus.png +0 -0
  54. data/html/images/date.png +0 -0
  55. data/html/images/delete.png +0 -0
  56. data/html/images/find.png +0 -0
  57. data/html/images/loadingAnimation.gif +0 -0
  58. data/html/images/macFFBgHack.png +0 -0
  59. data/html/images/package.png +0 -0
  60. data/html/images/page_green.png +0 -0
  61. data/html/images/page_white_text.png +0 -0
  62. data/html/images/page_white_width.png +0 -0
  63. data/html/images/plugin.png +0 -0
  64. data/html/images/ruby.png +0 -0
  65. data/html/images/tag_blue.png +0 -0
  66. data/html/images/tag_green.png +0 -0
  67. data/html/images/transparent.png +0 -0
  68. data/html/images/wrench.png +0 -0
  69. data/html/images/wrench_orange.png +0 -0
  70. data/html/images/zoom.png +0 -0
  71. data/html/index.html +363 -0
  72. data/html/js/darkfish.js +161 -0
  73. data/html/js/jquery.js +4 -0
  74. data/html/js/navigation.js +141 -0
  75. data/html/js/navigation.js.gz +0 -0
  76. data/html/js/search.js +109 -0
  77. data/html/js/search_index.js +1 -0
  78. data/html/js/search_index.js.gz +0 -0
  79. data/html/js/searcher.js +229 -0
  80. data/html/js/searcher.js.gz +0 -0
  81. data/html/table_of_contents.html +541 -0
  82. data/html/wwwjdic_gemspec.html +161 -0
  83. data/lib/wwwjdic/application.rb +233 -0
  84. data/lib/wwwjdic/constants.rb +113 -0
  85. data/lib/wwwjdic/locales/de.yml +29 -0
  86. data/lib/wwwjdic/locales/en.yml +29 -0
  87. data/lib/wwwjdic/locales/es.yml +29 -0
  88. data/lib/wwwjdic/locales/fr.yml +29 -0
  89. data/lib/wwwjdic/locales/hu.yml +29 -0
  90. data/lib/wwwjdic/locales/it.yml +29 -0
  91. data/lib/wwwjdic/locales/ja.yml +30 -0
  92. data/lib/wwwjdic/locales/nl.yml +29 -0
  93. data/lib/wwwjdic/locales/ru.yml +29 -0
  94. data/lib/wwwjdic/locales/sl.yml +29 -0
  95. data/lib/wwwjdic/locales/sv.yml +29 -0
  96. data/lib/wwwjdic/parser.rb +46 -0
  97. data/lib/wwwjdic/parsers/dict.rb +58 -0
  98. data/lib/wwwjdic/parsers/display.rb +50 -0
  99. data/lib/wwwjdic/parsers/key.rb +75 -0
  100. data/lib/wwwjdic/parsers/search.rb +60 -0
  101. data/lib/wwwjdic/parsers/server.rb +47 -0
  102. data/lib/wwwjdic/utils/downloader.rb +135 -0
  103. data/lib/wwwjdic/utils/raisers.rb +67 -0
  104. data/lib/wwwjdic/utils/splitter.rb +84 -0
  105. data/lib/wwwjdic/version.rb +20 -0
  106. data/lib/wwwjdic.rb +57 -0
  107. data/test/test_helper.rb +40 -0
  108. data/test/test_wwwjdic.rb +32 -0
  109. data/test/wwwjdic/locales/de.yml +22 -0
  110. data/test/wwwjdic/locales/en.yml +22 -0
  111. data/test/wwwjdic/locales/es.yml +22 -0
  112. data/test/wwwjdic/locales/fr.yml +22 -0
  113. data/test/wwwjdic/locales/hu.yml +22 -0
  114. data/test/wwwjdic/locales/it.yml +21 -0
  115. data/test/wwwjdic/locales/ja.yml +23 -0
  116. data/test/wwwjdic/locales/nl.yml +22 -0
  117. data/test/wwwjdic/locales/ru.yml +22 -0
  118. data/test/wwwjdic/locales/sl.yml +22 -0
  119. data/test/wwwjdic/locales/sv.yml +22 -0
  120. data/test/wwwjdic/locales/test_locales.rb +65 -0
  121. data/test/wwwjdic/parsers/test_dict.rb +73 -0
  122. data/test/wwwjdic/parsers/test_display.rb +51 -0
  123. data/test/wwwjdic/parsers/test_key.rb +52 -0
  124. data/test/wwwjdic/parsers/test_server.rb +51 -0
  125. data/test/wwwjdic/test_application.rb +219 -0
  126. data/test/wwwjdic/test_parsable_duck_type.rb +37 -0
  127. data/test/wwwjdic/utils/test_downloader.rb +41 -0
  128. data/test/wwwjdic/utils/test_raisers.rb +59 -0
  129. data/wwwjdic.gemspec +74 -0
  130. metadata +309 -0
@@ -0,0 +1,191 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class WWWJDic::Parsers::Dict - wwwjdic 13.0.0</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "../../";
11
+ var index_rel_prefix = "../../";
12
+ </script>
13
+
14
+ <script src="../../js/jquery.js"></script>
15
+ <script src="../../js/darkfish.js"></script>
16
+
17
+ <link href="../../css/fonts.css" rel="stylesheet">
18
+ <link href="../../css/rdoc.css" rel="stylesheet">
19
+
20
+
21
+
22
+
23
+ <body id="top" role="document" class="class">
24
+ <nav role="navigation">
25
+ <div id="project-navigation">
26
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
27
+ <h2>
28
+ <a href="../../index.html" rel="home">Home</a>
29
+ </h2>
30
+
31
+ <div id="table-of-contents-navigation">
32
+ <a href="../../table_of_contents.html#pages">Pages</a>
33
+ <a href="../../table_of_contents.html#classes">Classes</a>
34
+ <a href="../../table_of_contents.html#methods">Methods</a>
35
+ </div>
36
+ </div>
37
+
38
+ <div id="search-section" role="search" class="project-section initially-hidden">
39
+ <form action="#" method="get" accept-charset="utf-8">
40
+ <div id="search-field-wrapper">
41
+ <input id="search-field" role="combobox" aria-label="Search"
42
+ aria-autocomplete="list" aria-controls="search-results"
43
+ type="text" name="search" placeholder="Search" spellcheck="false"
44
+ title="Type to search, Up and Down to navigate, Enter to load">
45
+ </div>
46
+
47
+ <ul id="search-results" aria-label="Search Results"
48
+ aria-busy="false" aria-expanded="false"
49
+ aria-atomic="false" class="initially-hidden"></ul>
50
+ </form>
51
+ </div>
52
+
53
+ </div>
54
+
55
+
56
+
57
+ <div id="class-metadata">
58
+
59
+ <div id="parent-class-section" class="nav-section">
60
+ <h3>Parent</h3>
61
+
62
+
63
+ <p class="link"><a href="../../Object.html">Object</a>
64
+
65
+ </div>
66
+
67
+ <div id="includes-section" class="nav-section">
68
+ <h3>Included Modules</h3>
69
+
70
+ <ul class="link-list">
71
+
72
+
73
+ <li><a class="include" href="../Utils/Raisers.html">WWWJDic::Utils::Raisers</a>
74
+
75
+
76
+ </ul>
77
+ </div>
78
+
79
+
80
+ <!-- Method Quickref -->
81
+ <div id="method-list-section" class="nav-section">
82
+ <h3>Methods</h3>
83
+
84
+ <ul class="link-list" role="directory">
85
+
86
+ <li ><a href="#method-i-parse">#parse</a>
87
+
88
+ </ul>
89
+ </div>
90
+
91
+ </div>
92
+ </nav>
93
+
94
+ <main role="main" aria-labelledby="class-WWWJDic::Parsers::Dict">
95
+ <h1 id="class-WWWJDic::Parsers::Dict" class="class">
96
+ class WWWJDic::Parsers::Dict
97
+ </h1>
98
+
99
+ <section class="description">
100
+
101
+ <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
+
103
+ <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>
104
+ <dl class="rdoc-list note-list"><dt>Author
105
+ <dd>
106
+ <p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
107
+ </dd><dt>Copyright
108
+ <dd>
109
+ <p>Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani</p>
110
+ </dd><dt>License
111
+ <dd>
112
+ <p>GNU General Public License version 3</p>
113
+ </dd></dl>
114
+
115
+ </section>
116
+
117
+
118
+ <section id="5Buntitled-5D" class="documentation-section">
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
129
+ <header>
130
+ <h3>Public Instance Methods</h3>
131
+ </header>
132
+
133
+
134
+ <div id="method-i-parse" class="method-detail ">
135
+
136
+ <div class="method-heading">
137
+ <span class="method-name">parse</span><span
138
+ class="method-args">(value = &#39;1&#39;)</span>
139
+
140
+ <span class="method-click-advice">click to toggle source</span>
141
+
142
+ </div>
143
+
144
+
145
+ <div class="method-description">
146
+
147
+ <p>The parsable duck type interface to every parser usage.</p>
148
+
149
+
150
+
151
+
152
+ <div class="method-source-code" id="parse-source">
153
+ <pre> <span class="ruby-comment"># File lib/wwwjdic/parsers/dict.rb</span>
154
+ <span class="line-num">41</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">&#39;1&#39;</span>)
155
+ <span class="line-num">42</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">&#39;error.nil&#39;</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
156
+ <span class="line-num">43</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">&#39;error.param&#39;</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>
157
+ <span class="line-num">44</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">&#39;error.param&#39;</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>
158
+ <span class="line-num">45</span>
159
+ <span class="line-num">46</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>
160
+ <span class="line-num">47</span> <span class="ruby-identifier">raiser_array</span>(<span class="ruby-string">&#39;error.param&#39;</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">DICTIONARY_CODES</span>)
161
+ <span class="line-num">48</span> <span class="ruby-identifier">value</span>
162
+ <span class="line-num">49</span> <span class="ruby-keyword">else</span>
163
+ <span class="line-num">50</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
164
+ <span class="line-num">51</span> <span class="ruby-identifier">raiser_array</span>(<span class="ruby-string">&#39;error.param&#39;</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">DICTIONARY_NAMES</span>)
165
+ <span class="line-num">52</span> <span class="ruby-constant">DICTS_BY_NAMES</span>[<span class="ruby-identifier">value</span>]
166
+ <span class="line-num">53</span> <span class="ruby-keyword">end</span>
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>
169
+ </div>
170
+
171
+ </div>
172
+
173
+
174
+
175
+
176
+ </div>
177
+
178
+
179
+ </section>
180
+
181
+ </section>
182
+
183
+ </main>
184
+
185
+
186
+ <footer id="validator-badges" role="contentinfo">
187
+ <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.1.1.
189
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
190
+ </footer>
191
+
@@ -0,0 +1,184 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class WWWJDic::Parsers::Display - wwwjdic 13.0.0</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "../../";
11
+ var index_rel_prefix = "../../";
12
+ </script>
13
+
14
+ <script src="../../js/jquery.js"></script>
15
+ <script src="../../js/darkfish.js"></script>
16
+
17
+ <link href="../../css/fonts.css" rel="stylesheet">
18
+ <link href="../../css/rdoc.css" rel="stylesheet">
19
+
20
+
21
+
22
+
23
+ <body id="top" role="document" class="class">
24
+ <nav role="navigation">
25
+ <div id="project-navigation">
26
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
27
+ <h2>
28
+ <a href="../../index.html" rel="home">Home</a>
29
+ </h2>
30
+
31
+ <div id="table-of-contents-navigation">
32
+ <a href="../../table_of_contents.html#pages">Pages</a>
33
+ <a href="../../table_of_contents.html#classes">Classes</a>
34
+ <a href="../../table_of_contents.html#methods">Methods</a>
35
+ </div>
36
+ </div>
37
+
38
+ <div id="search-section" role="search" class="project-section initially-hidden">
39
+ <form action="#" method="get" accept-charset="utf-8">
40
+ <div id="search-field-wrapper">
41
+ <input id="search-field" role="combobox" aria-label="Search"
42
+ aria-autocomplete="list" aria-controls="search-results"
43
+ type="text" name="search" placeholder="Search" spellcheck="false"
44
+ title="Type to search, Up and Down to navigate, Enter to load">
45
+ </div>
46
+
47
+ <ul id="search-results" aria-label="Search Results"
48
+ aria-busy="false" aria-expanded="false"
49
+ aria-atomic="false" class="initially-hidden"></ul>
50
+ </form>
51
+ </div>
52
+
53
+ </div>
54
+
55
+
56
+
57
+ <div id="class-metadata">
58
+
59
+ <div id="parent-class-section" class="nav-section">
60
+ <h3>Parent</h3>
61
+
62
+
63
+ <p class="link"><a href="../../Object.html">Object</a>
64
+
65
+ </div>
66
+
67
+ <div id="includes-section" class="nav-section">
68
+ <h3>Included Modules</h3>
69
+
70
+ <ul class="link-list">
71
+
72
+
73
+ <li><a class="include" href="../Utils/Raisers.html">WWWJDic::Utils::Raisers</a>
74
+
75
+
76
+ </ul>
77
+ </div>
78
+
79
+
80
+ <!-- Method Quickref -->
81
+ <div id="method-list-section" class="nav-section">
82
+ <h3>Methods</h3>
83
+
84
+ <ul class="link-list" role="directory">
85
+
86
+ <li ><a href="#method-i-parse">#parse</a>
87
+
88
+ </ul>
89
+ </div>
90
+
91
+ </div>
92
+ </nav>
93
+
94
+ <main role="main" aria-labelledby="class-WWWJDic::Parsers::Display">
95
+ <h1 id="class-WWWJDic::Parsers::Display" class="class">
96
+ class WWWJDic::Parsers::Display
97
+ </h1>
98
+
99
+ <section class="description">
100
+
101
+ <p>This class is an implementation of the Parsable duck type that checks the display type. The only needed parameter is a boolean, with <code>true</code> for regular.</p>
102
+
103
+ <p>M = backdoor entry (regular display) or Z = backdoor entry (raw dictionary display)</p>
104
+ <dl class="rdoc-list note-list"><dt>Author
105
+ <dd>
106
+ <p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
107
+ </dd><dt>Copyright
108
+ <dd>
109
+ <p>Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani</p>
110
+ </dd><dt>License
111
+ <dd>
112
+ <p>GNU General Public License version 3</p>
113
+ </dd></dl>
114
+
115
+ </section>
116
+
117
+
118
+ <section id="5Buntitled-5D" class="documentation-section">
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
129
+ <header>
130
+ <h3>Public Instance Methods</h3>
131
+ </header>
132
+
133
+
134
+ <div id="method-i-parse" class="method-detail ">
135
+
136
+ <div class="method-heading">
137
+ <span class="method-name">parse</span><span
138
+ class="method-args">(value = :display)</span>
139
+
140
+ <span class="method-click-advice">click to toggle source</span>
141
+
142
+ </div>
143
+
144
+
145
+ <div class="method-description">
146
+
147
+ <p>The parsable duck type interface to every parser usage.</p>
148
+
149
+
150
+
151
+
152
+ <div class="method-source-code" id="parse-source">
153
+ <pre> <span class="ruby-comment"># File lib/wwwjdic/parsers/display.rb</span>
154
+ <span class="line-num">40</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse</span>(<span class="ruby-identifier">value</span> = <span class="ruby-value">:display</span>)
155
+ <span class="line-num">41</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">&#39;error.nil&#39;</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
156
+ <span class="line-num">42</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">&#39;error.param&#39;</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">is_a?</span> <span class="ruby-constant">Symbol</span>
157
+ <span class="line-num">43</span>
158
+ <span class="line-num">44</span> <span class="ruby-identifier">raiser_array</span>(<span class="ruby-string">&#39;error.param&#39;</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">DISPLAY</span>.<span class="ruby-identifier">keys</span>)
159
+ <span class="line-num">45</span>
160
+ <span class="line-num">46</span> <span class="ruby-identifier">value</span>
161
+ <span class="line-num">47</span> <span class="ruby-keyword">end</span></pre>
162
+ </div>
163
+
164
+ </div>
165
+
166
+
167
+
168
+
169
+ </div>
170
+
171
+
172
+ </section>
173
+
174
+ </section>
175
+
176
+ </main>
177
+
178
+
179
+ <footer id="validator-badges" role="contentinfo">
180
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
181
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
182
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
183
+ </footer>
184
+
@@ -0,0 +1,221 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class WWWJDic::Parsers::Key - wwwjdic 13.0.0</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "../../";
11
+ var index_rel_prefix = "../../";
12
+ </script>
13
+
14
+ <script src="../../js/jquery.js"></script>
15
+ <script src="../../js/darkfish.js"></script>
16
+
17
+ <link href="../../css/fonts.css" rel="stylesheet">
18
+ <link href="../../css/rdoc.css" rel="stylesheet">
19
+
20
+
21
+
22
+
23
+ <body id="top" role="document" class="class">
24
+ <nav role="navigation">
25
+ <div id="project-navigation">
26
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
27
+ <h2>
28
+ <a href="../../index.html" rel="home">Home</a>
29
+ </h2>
30
+
31
+ <div id="table-of-contents-navigation">
32
+ <a href="../../table_of_contents.html#pages">Pages</a>
33
+ <a href="../../table_of_contents.html#classes">Classes</a>
34
+ <a href="../../table_of_contents.html#methods">Methods</a>
35
+ </div>
36
+ </div>
37
+
38
+ <div id="search-section" role="search" class="project-section initially-hidden">
39
+ <form action="#" method="get" accept-charset="utf-8">
40
+ <div id="search-field-wrapper">
41
+ <input id="search-field" role="combobox" aria-label="Search"
42
+ aria-autocomplete="list" aria-controls="search-results"
43
+ type="text" name="search" placeholder="Search" spellcheck="false"
44
+ title="Type to search, Up and Down to navigate, Enter to load">
45
+ </div>
46
+
47
+ <ul id="search-results" aria-label="Search Results"
48
+ aria-busy="false" aria-expanded="false"
49
+ aria-atomic="false" class="initially-hidden"></ul>
50
+ </form>
51
+ </div>
52
+
53
+ </div>
54
+
55
+
56
+
57
+ <div id="class-metadata">
58
+
59
+ <div id="parent-class-section" class="nav-section">
60
+ <h3>Parent</h3>
61
+
62
+
63
+ <p class="link"><a href="../../Object.html">Object</a>
64
+
65
+ </div>
66
+
67
+ <div id="includes-section" class="nav-section">
68
+ <h3>Included Modules</h3>
69
+
70
+ <ul class="link-list">
71
+
72
+
73
+ <li><a class="include" href="../Utils/Raisers.html">WWWJDic::Utils::Raisers</a>
74
+
75
+
76
+ </ul>
77
+ </div>
78
+
79
+
80
+ <!-- Method Quickref -->
81
+ <div id="method-list-section" class="nav-section">
82
+ <h3>Methods</h3>
83
+
84
+ <ul class="link-list" role="directory">
85
+
86
+ <li ><a href="#method-i-parse">#parse</a>
87
+
88
+ </ul>
89
+ </div>
90
+
91
+ </div>
92
+ </nav>
93
+
94
+ <main role="main" aria-labelledby="class-WWWJDic::Parsers::Key">
95
+ <h1 id="class-WWWJDic::Parsers::Key" class="class">
96
+ class WWWJDic::Parsers::Key
97
+ </h1>
98
+
99
+ <section class="description">
100
+
101
+ <p>This class is an implementation of the Parsable duck type that checks the display type. The only needed parameter is the word to translate.</p>
102
+
103
+ <p>k is the key type:</p>
104
+ <ul><li>
105
+ <p>for dictionary lookups</p>
106
+ <ul><li>
107
+ <p>for English keys use E, or P to get just “common words”, Q to</p>
108
+ </li></ul>
109
+ </li></ul>
110
+
111
+ <p>get an “exact match” and R to get both;</p>
112
+
113
+ <pre>* for Japanese keys use J (this is mandatory for romaji keys),</pre>
114
+
115
+ <p>P to get just “common words” (doesn&#39;t work with romaji), K for keys starting with kanji (first position), and L for kanji keys in any position.</p>
116
+ <ul><li>
117
+ <p>for kanji lookups, use M followed by the KANJIDIC letter codes</p>
118
+ </li></ul>
119
+
120
+ <p>(B, U, V, N, etc.) or J if a reading or kanji is being provided. An optional stroke-count or stroke-count range can be included by placing it between “=” characters;</p>
121
+ <ul><li>
122
+ <p>for text glossing use G, or H to turn on the “no repeated</p>
123
+ </li></ul>
124
+
125
+ <p>translations“ option.</p>
126
+ <ul><li>
127
+ <p>for multi-radical kanji lookups use J for jouyou kanji-only, H</p>
128
+ </li></ul>
129
+
130
+ <p>to include JIS X 0212 kanji, and X for anything else. An optional stroke-count or stroke-count range can be included by placing it between “=” characters.</p>
131
+ <ul><li>
132
+ <p>for example sentence lookups with indexed words use E for EUC,</p>
133
+ </li></ul>
134
+
135
+ <p>ISO-2022-JP or UCS, S for Shift_JIS and U for UTF-8, followed by “lookupword=n=kana=”. The kana is optional and is there to disambiguate between different headwords. For “n”, 1 =&gt; random selection of 10, anything else =&gt; display up to 100 sentences starting at n.</p>
136
+ <ul><li>
137
+ <p>for example sentence lookups using a regular expression, use E</p>
138
+ </li></ul>
139
+
140
+ <p>for EUC, ISO-2022-JP or UCS, S for Shift_JIS and U for UTF-8, followed by the search string. Up to 99 example sentences may be displayed.</p>
141
+ <dl class="rdoc-list note-list"><dt>Author
142
+ <dd>
143
+ <p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
144
+ </dd><dt>Copyright
145
+ <dd>
146
+ <p>Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani</p>
147
+ </dd><dt>License
148
+ <dd>
149
+ <p>GNU General Public License version 3</p>
150
+ </dd></dl>
151
+
152
+ </section>
153
+
154
+
155
+ <section id="5Buntitled-5D" class="documentation-section">
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
166
+ <header>
167
+ <h3>Public Instance Methods</h3>
168
+ </header>
169
+
170
+
171
+ <div id="method-i-parse" class="method-detail ">
172
+
173
+ <div class="method-heading">
174
+ <span class="method-name">parse</span><span
175
+ class="method-args">(value = :exact)</span>
176
+
177
+ <span class="method-click-advice">click to toggle source</span>
178
+
179
+ </div>
180
+
181
+
182
+ <div class="method-description">
183
+
184
+ <p>The parsable duck type interface to every parser usage.</p>
185
+
186
+
187
+
188
+
189
+ <div class="method-source-code" id="parse-source">
190
+ <pre> <span class="ruby-comment"># File lib/wwwjdic/parsers/key.rb</span>
191
+ <span class="line-num">65</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse</span>(<span class="ruby-identifier">value</span> = <span class="ruby-value">:exact</span>)
192
+ <span class="line-num">66</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">&#39;error.nil&#39;</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
193
+ <span class="line-num">67</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">&#39;error.param&#39;</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">is_a?</span> <span class="ruby-constant">Symbol</span>
194
+ <span class="line-num">68</span>
195
+ <span class="line-num">69</span> <span class="ruby-identifier">raiser_array</span>(<span class="ruby-string">&#39;error.param&#39;</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">KEYS</span>.<span class="ruby-identifier">keys</span>)
196
+ <span class="line-num">70</span>
197
+ <span class="line-num">71</span> <span class="ruby-identifier">value</span>
198
+ <span class="line-num">72</span> <span class="ruby-keyword">end</span></pre>
199
+ </div>
200
+
201
+ </div>
202
+
203
+
204
+
205
+
206
+ </div>
207
+
208
+
209
+ </section>
210
+
211
+ </section>
212
+
213
+ </main>
214
+
215
+
216
+ <footer id="validator-badges" role="contentinfo">
217
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
218
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
219
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
220
+ </footer>
221
+