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.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +60 -1
  3. data/Gemfile +7 -1
  4. data/README.md +500 -225
  5. data/Rakefile +10 -3
  6. data/copyright.md +17 -29
  7. data/examples/basics.rb +53 -45
  8. data/examples/translate.rb +159 -86
  9. data/examples/uri.rb +46 -78
  10. data/html/CHANGELOG.html +90 -35
  11. data/html/COPYING_md.html +26 -38
  12. data/html/Gemfile.html +25 -35
  13. data/html/Object.html +838 -74
  14. data/html/README_md.html +322 -175
  15. data/html/Rakefile.html +28 -38
  16. data/html/WWWJDic.html +63 -104
  17. data/html/WWWJDic/ParsableDuckType.html +38 -58
  18. data/html/WWWJDic/Parser.html +52 -92
  19. data/html/WWWJDic/Parsers.html +29 -35
  20. data/html/WWWJDic/Parsers/Dict.html +50 -76
  21. data/html/WWWJDic/Parsers/Display.html +45 -69
  22. data/html/WWWJDic/Parsers/Key.html +46 -70
  23. data/html/WWWJDic/Parsers/Search.html +41 -61
  24. data/html/WWWJDic/Parsers/Server.html +45 -69
  25. data/html/WWWJDic/Splitter.html +81 -175
  26. data/html/WWWJDic/Utils.html +30 -36
  27. data/html/WWWJDic/Utils/Downloader.html +41 -41
  28. data/html/WWWJDic/Utils/Downloader/Downloader.html +65 -92
  29. data/html/WWWJDic/Utils/Raisers.html +46 -98
  30. data/html/WWWJDic/WWWJDic.html +166 -348
  31. data/html/copyright_md.html +219 -239
  32. data/html/created.rid +33 -58
  33. data/html/css/rdoc.css +638 -590
  34. data/html/index.html +313 -182
  35. data/html/js/darkfish.js +84 -161
  36. data/html/js/navigation.js +4 -40
  37. data/html/js/navigation.js.gz +0 -0
  38. data/html/js/search.js +109 -109
  39. data/html/js/search_index.js +1 -1
  40. data/html/js/search_index.js.gz +0 -0
  41. data/html/js/searcher.js +228 -229
  42. data/html/js/searcher.js.gz +0 -0
  43. data/html/table_of_contents.html +161 -200
  44. data/lib/wwwjdic.rb +14 -15
  45. data/lib/wwwjdic/application.rb +68 -36
  46. data/lib/wwwjdic/constants.rb +56 -12
  47. data/lib/wwwjdic/locales/de.yml +9 -4
  48. data/lib/wwwjdic/locales/en.yml +9 -4
  49. data/lib/wwwjdic/locales/es.yml +9 -4
  50. data/lib/wwwjdic/locales/fr.yml +9 -4
  51. data/lib/wwwjdic/locales/hu.yml +9 -4
  52. data/lib/wwwjdic/locales/it.yml +9 -4
  53. data/lib/wwwjdic/locales/ja.yml +11 -5
  54. data/lib/wwwjdic/locales/nl.yml +9 -4
  55. data/lib/wwwjdic/locales/ru.yml +9 -4
  56. data/lib/wwwjdic/locales/sl.yml +9 -4
  57. data/lib/wwwjdic/locales/sv.yml +9 -4
  58. data/lib/wwwjdic/parser.rb +13 -8
  59. data/lib/wwwjdic/parsers/dict.rb +11 -8
  60. data/lib/wwwjdic/parsers/display.rb +8 -3
  61. data/lib/wwwjdic/parsers/key.rb +9 -3
  62. data/lib/wwwjdic/parsers/search.rb +10 -3
  63. data/lib/wwwjdic/parsers/server.rb +8 -3
  64. data/lib/wwwjdic/utils/downloader.rb +37 -34
  65. data/lib/wwwjdic/utils/raisers.rb +12 -15
  66. data/lib/wwwjdic/utils/splitter.rb +32 -18
  67. data/lib/wwwjdic/version.rb +22 -8
  68. data/test/test_helper.rb +10 -1
  69. data/test/test_wwwjdic.rb +10 -4
  70. data/test/wwwjdic/locales/de.yml +9 -1
  71. data/test/wwwjdic/locales/en.yml +9 -1
  72. data/test/wwwjdic/locales/es.yml +9 -1
  73. data/test/wwwjdic/locales/fr.yml +9 -1
  74. data/test/wwwjdic/locales/hu.yml +9 -1
  75. data/test/wwwjdic/locales/it.yml +10 -1
  76. data/test/wwwjdic/locales/ja.yml +11 -2
  77. data/test/wwwjdic/locales/nl.yml +9 -1
  78. data/test/wwwjdic/locales/ru.yml +9 -1
  79. data/test/wwwjdic/locales/sl.yml +9 -1
  80. data/test/wwwjdic/locales/sv.yml +9 -1
  81. data/test/wwwjdic/locales/test_locales.rb +41 -24
  82. data/test/wwwjdic/parsers/test_dict.rb +65 -37
  83. data/test/wwwjdic/parsers/test_display.rb +11 -5
  84. data/test/wwwjdic/parsers/test_key.rb +10 -4
  85. data/test/wwwjdic/parsers/test_server.rb +11 -5
  86. data/test/wwwjdic/test_application.rb +199 -149
  87. data/test/wwwjdic/test_parsable_duck_type.rb +9 -5
  88. data/test/wwwjdic/utils/test_downloader.rb +7 -1
  89. data/test/wwwjdic/utils/test_raisers.rb +46 -29
  90. data/wwwjdic.gemspec +44 -26
  91. metadata +55 -43
  92. data/acknowledgements.md +0 -55
  93. data/authors.md +0 -67
  94. data/html/acknowledgements_md.html +0 -149
  95. data/html/authors_md.html +0 -181
  96. data/html/js/jquery.js +0 -4
  97. data/html/wwwjdic_gemspec.html +0 -161
data/html/index.html CHANGED
@@ -4,26 +4,27 @@
4
4
  <head>
5
5
  <meta charset="UTF-8">
6
6
 
7
- <title>wwwjdic 13.0.1</title>
7
+ <title>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/jquery.js"></script>
15
- <script src="./js/darkfish.js"></script>
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="file">
24
+ <body class="file" 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" class="nav-section">
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>
@@ -36,87 +37,58 @@
36
37
  </div>
37
38
 
38
39
 
39
- <div id="search-section" role="search" class="project-section initially-hidden">
40
- <form action="#" method="get" accept-charset="utf-8">
40
+ <div class="project-section initially-hidden" id="search-section" role="search">
41
+ <form accept-charset="utf-8" action="#" method="get">
41
42
  <div id="search-field-wrapper">
42
- <input id="search-field" role="combobox" aria-label="Search"
43
- aria-autocomplete="list" aria-controls="search-results"
44
- type="text" name="search" placeholder="Search" spellcheck="false"
45
- title="Type to search, Up and Down to navigate, Enter to load">
43
+ <input aria-autocomplete="list" aria-controls="search-results" aria-label="Search"
44
+ id="search-field" name="search"
45
+ placeholder="Search" role="combobox" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"
46
+ type="text">
46
47
  </div>
47
48
 
48
- <ul id="search-results" aria-label="Search Results"
49
- aria-busy="false" aria-expanded="false"
50
- aria-atomic="false" class="initially-hidden"></ul>
49
+ <ul aria-atomic="false" aria-busy="false"
50
+ aria-expanded="false" aria-label="Search Results"
51
+ class="initially-hidden" id="search-results"></ul>
51
52
  </form>
52
53
  </div>
53
54
 
54
55
  </div>
55
56
 
56
57
  <div id="project-metadata">
57
- <div id="fileindex-section" class="nav-section">
58
+
59
+ <div class="nav-section" id="fileindex-section">
58
60
  <h3>Pages</h3>
59
61
 
60
62
  <ul class="link-list">
61
-
62
63
  <li><a href="./CHANGELOG.html">CHANGELOG</a>
63
-
64
64
  <li><a href="./COPYING_md.html">COPYING</a>
65
-
66
65
  <li><a href="./Gemfile.html">Gemfile</a>
67
-
68
66
  <li><a href="./README_md.html">README</a>
69
-
70
67
  <li><a href="./Rakefile.html">Rakefile</a>
71
-
72
- <li><a href="./acknowledgements_md.html">acknowledgements</a>
73
-
74
- <li><a href="./authors_md.html">authors</a>
75
-
76
68
  <li><a href="./copyright_md.html">copyright</a>
77
-
78
- <li><a href="./wwwjdic_gemspec.html">wwwjdic.gemspec</a>
79
-
80
69
  </ul>
81
70
  </div>
82
71
 
83
- <div id="classindex-section" class="nav-section">
72
+ <div class="nav-section" id="classindex-section">
84
73
  <h3>Class and Module Index</h3>
85
74
 
86
75
  <ul class="link-list">
87
-
88
76
  <li><a href="./Object.html">Object</a>
89
-
90
77
  <li><a href="./WWWJDic.html">WWWJDic</a>
91
-
92
78
  <li><a href="./WWWJDic/ParsableDuckType.html">WWWJDic::ParsableDuckType</a>
93
-
94
79
  <li><a href="./WWWJDic/Parser.html">WWWJDic::Parser</a>
95
-
96
80
  <li><a href="./WWWJDic/Parsers.html">WWWJDic::Parsers</a>
97
-
98
81
  <li><a href="./WWWJDic/Parsers/Dict.html">WWWJDic::Parsers::Dict</a>
99
-
100
82
  <li><a href="./WWWJDic/Parsers/Display.html">WWWJDic::Parsers::Display</a>
101
-
102
83
  <li><a href="./WWWJDic/Parsers/Key.html">WWWJDic::Parsers::Key</a>
103
-
104
84
  <li><a href="./WWWJDic/Parsers/Search.html">WWWJDic::Parsers::Search</a>
105
-
106
85
  <li><a href="./WWWJDic/Parsers/Server.html">WWWJDic::Parsers::Server</a>
107
-
108
86
  <li><a href="./WWWJDic/Splitter.html">WWWJDic::Splitter</a>
109
-
110
87
  <li><a href="./WWWJDic/Utils.html">WWWJDic::Utils</a>
111
-
112
88
  <li><a href="./WWWJDic/Utils/Downloader.html">WWWJDic::Utils::Downloader</a>
113
-
114
89
  <li><a href="./WWWJDic/Utils/Downloader/Downloader.html">WWWJDic::Utils::Downloader::Downloader</a>
115
-
116
90
  <li><a href="./WWWJDic/Utils/Raisers.html">WWWJDic::Utils::Raisers</a>
117
-
118
91
  <li><a href="./WWWJDic/WWWJDic.html">WWWJDic::WWWJDic</a>
119
-
120
92
  </ul>
121
93
  </div>
122
94
 
@@ -128,7 +100,7 @@
128
100
  <!--
129
101
  wwwjdic
130
102
 
131
- Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani
103
+ © 2014-2021 Marco Bresciani
132
104
 
133
105
  This file is part of wwwjdic.
134
106
 
@@ -144,68 +116,67 @@ more details.
144
116
 
145
117
  You should have received a copy of the GNU General Public License along
146
118
  with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
147
- -->
148
- <h1 id="label-WWWJDic"><a href="WWWJDic.html"><code>WWWJDic</code></a><span><a href="#label-WWWJDic">&para;</a> <a href="#top">&uarr;</a></span></h1>
149
-
150
- <p><img src="https://img.shields.io/gem/v/wwwjdic.svg?style=plastic"> <img src="https://img.shields.io/gem/dt/wwwjdic.svg?style=plastic"> <img src="https://img.shields.io/gem/dtv/wwwjdic.svg?style=plastic"> <img src="https://img.shields.io/gem/rt/wwwjdic.svg?style=plastic"> <img src="https://img.shields.io/gem/rd/wwwjdic.svg?style=plastic"> <img src="https://img.shields.io/librariesio/dependent-repos/rubygems/wwwjdic.svg?style=plastic"></p>
151
-
152
- <p>Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani</p>
153
-
154
- <p>This file is part of wwwjdic.</p>
155
-
156
- <p>wwwjdic is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
157
-
158
- <p>wwwjdic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
159
-
160
- <p>You should have received a copy of the GNU General Public License along with wwwjdic. If not, see <a href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.</p>
161
-
162
- <h2 id="label-Description">Description<span><a href="#label-Description">&para;</a> <a href="#top">&uarr;</a></span></h2>
163
-
164
- <p>This gem uses <a href="WWWJDic.html"><code>WWWJDic</code></a> Backdoor Entry/API as described by <a href="http://www.csse.monash.edu.au/~jwb/wwwjdicinf.html#backdoor_tag">www.csse.monash.edu.au/~jwb/wwwjdicinf.html#backdoor_tag</a> to interact with <a href="WWWJDic.html"><code>WWWJDic</code></a> and translate to and from Japanese language.</p>
165
119
 
166
- <p><a href="WWWJDic.html"><code>WWWJDic</code></a> is an online Japanese translation server made by Jim Breen and available at <a href="http://www.edrdg.org/cgi-bin/wwwjdic/wwwjdic?1C">www.edrdg.org/cgi-bin/wwwjdic/wwwjdic?1C</a> .</p>
120
+ SPDX-FileCopyrightText: 2014-2021 Marco Bresciani
167
121
 
168
- <p>GNU GPLv3 license; source code (not yet) available through anonymous checkout: <code>hg clone http://hg.savannah.nongnu.org/hgweb/wwwjdic/</code> or write me and I&#39;ll send it.</p>
169
-
170
- <p>You can even decide to contribute to this little free software project by registering to Savannah and ask to be part of the &#39;WWWJDic&#39; project! With contributions from: Jim Breen, 新部裕, Jon Maken.</p>
171
-
172
- <h2 id="label-Documentation">Documentation<span><a href="#label-Documentation">&para;</a> <a href="#top">&uarr;</a></span></h2>
122
+ SPDX-License-Identifier: GFDL-1.3-or-later
123
+ -->
124
+ <h1 id="label-WWWJDic"><a href="WWWJDic.html"><code>WWWJDic</code></a><span><a href="#label-WWWJDic">&para;</a> <a href="#top">&uarr;</a></span></h1>
173
125
 
174
- <p><a href="WWWJDic.html"><code>WWWJDic</code></a> tries to follow semantic versioning (see <a href="http://semver.org">semver.org</a>/). There may be backward incompatible changes each time minor version number changes, but that any tiny version number change should be bug fixes and internal changes only. Be sure to read the <a href="CHANGELOG.html">CHANGELOG</a> each time we cut a new release and lock your gems accordingly.</p>
126
+ <p><img src="https://badgen.net/rubygems/n/wwwjdic"> <img src="https://badgen.net/rubygems/v/wwwjdic/latest"> <img src="https://badgen.net/rubygems/p/wwwjdic"></p>
175
127
 
176
- <p>RDoc documentation available in the html folder.</p>
128
+ <p><a href="https://github.com/RichardLitt/standard-readme"><img src="https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=plastic"></a> <a href="https://github.com/rubocop-hq/rubocop"><img src="https://img.shields.io/badge/code_style-rubocop-brightgreen.svg"></a> <a href="https://api.reuse.software/info/git.fsfe.org/reuse/api"><img src="https://api.reuse.software/badge/git.fsfe.org/reuse/api"></a></p>
177
129
 
178
- <h3 id="label-Installing+WWWJDic">Installing <a href="WWWJDic.html"><code>WWWJDic</code></a><span><a href="#label-Installing+WWWJDic">&para;</a> <a href="#top">&uarr;</a></span></h3>
130
+ <p><img src="https://badgen.net/rubygems/dt/wwwjdic"> <img src="https://badgen.net/rubygems/dv/wwwjdic"></p>
179
131
 
180
- <p>RubyGems is the preferred easy install method for <a href="WWWJDic.html"><code>WWWJDic</code></a>. <a href="WWWJDic.html"><code>WWWJDic</code></a> is intended to be installed via the <a href="http://rubyforge.org/projects/rubygems/">RubyGems</a> system. To get the latest version, simply enter the following into your command prompt: <code>gem install wwwjdic</code>.</p>
132
+ <p><img src="https://img.shields.io/gem/rt/wwwjdic.svg?style=plastic"> <img src="https://img.shields.io/gem/rd/wwwjdic.svg?style=plastic"> <img src="https://img.shields.io/librariesio/dependent-repos/rubygems/wwwjdic.svg?style=plastic"> <img src="https://img.shields.io/gem/u/MarcoBresciani?style=plastic"></p>
181
133
 
182
- <h3 id="label-Supported+Ruby+Versions+and+Implementations">Supported Ruby Versions and Implementations<span><a href="#label-Supported+Ruby+Versions+and+Implementations">&para;</a> <a href="#top">&uarr;</a></span></h3>
134
+ <p><img src="https://img.shields.io/security-headers?style=plastic&url=https%3A%2F%2Fsavannah.nongnu.org%2Fprojects%2Faamfp"> <img src="https://img.shields.io/hsts/preload/savannah.nongnu.org?style=plastic"> <img src="https://img.shields.io/mozilla-observatory/grade/savannah.nongnu.org?publish&style=plastic"> <img src="https://img.shields.io/website?style=plastic&url=https%3A%2F%2Fsavannah.nongnu.org%2Fprojects%2Faamfp"></p>
183
135
 
184
- <p>Because <a href="WWWJDic.html"><code>WWWJDic</code></a> is pure Ruby, it should run pretty much anywhere, including Rubinius, JRuby, MacRuby, etc. Officially the support is for 2.x MRI.</p>
136
+ <p>This gem uses <a href="WWWJDic.html"><code>WWWJDic</code></a> Backdoor Entry/API to interact with <a href="WWWJDic.html"><code>WWWJDic</code></a> and translate to and from Japanese language.</p>
185
137
 
186
- <h3 id="label-Support">Support<span><a href="#label-Support">&para;</a> <a href="#top">&uarr;</a></span></h3>
138
+ <p>This gem uses <a href="WWWJDic.html"><code>WWWJDic</code></a> Backdoor Entry/API as described by <a href="http://www.edrdg.org/wwwjdic/wwwjdicinf.html#backdoor_tag">www.edrdg.org/wwwjdic/wwwjdicinf.html#backdoor_tag</a> to interact with <a href="WWWJDic.html"><code>WWWJDic</code></a> and translate to and from Japanese language. <a href="WWWJDic.html"><code>WWWJDic</code></a> is an online Japanese translation server made by Jim Breen and available at <a href="http://www.edrdg.org/cgi-bin/wwwjdic/wwwjdic?1C">www.edrdg.org/cgi-bin/wwwjdic/wwwjdic?1C</a>. GNU GPLv3 license; source code available through anonymous checkout: <code>hg clone http://hg.savannah.nongnu.org/hgweb/wwwjdic/</code> or write me, and I&#39;ll send it. You can even decide to contribute to this little free software project by registering to Savannah and ask to be part of the <code>wwwjdic</code> project!</p>
187
139
 
188
- <p>The easiest way to get help with <a href="WWWJDic.html"><code>WWWJDic</code></a> is to post a message to the mailing list: <code>http://lists.nongnu.org/mailman/listinfo/wwwjdic-users</code></p>
140
+ <h2 id="label-Table+of+Contents">Table of Contents<span><a href="#label-Table+of+Contents">&para;</a> <a href="#top">&uarr;</a></span></h2>
141
+ <ul><li>
142
+ <p><a href="#background">Background</a></p>
143
+ </li><li>
144
+ <p><a href="#install">Install</a></p>
145
+ </li><li>
146
+ <p><a href="#savannah">Savannah</a></p>
147
+ </li><li>
148
+ <p><a href="#rubygems">RubyGems</a></p>
149
+ </li><li>
150
+ <p><a href="#usage">Usage</a></p>
151
+ </li><li>
152
+ <p><a href="#maintainers">Maintainers</a></p>
153
+ </li><li>
154
+ <p><a href="#thanks">Thanks</a></p>
155
+ </li><li>
156
+ <p><a href="#contributing">Contributing</a></p>
157
+ </li><li>
158
+ <p><a href="#license">License</a></p>
159
+ </li></ul>
189
160
 
190
- <p>Feel free to post any question there, developers are responsive and will be happy to help you figure out how to use <a href="WWWJDic.html"><code>WWWJDic</code></a>, or help you determine whether it&#39;s the right tool for the task you are working on.</p>
161
+ <h2 id="label-Background">Background<span><a href="#label-Background">&para;</a> <a href="#top">&uarr;</a></span></h2>
191
162
 
192
- <p>Please make your posts to the list as specific as possible, including code samples and output where relevant. Do not post any information that should not be shared publicly, and be sure to reduce your example code as much as possible so that those who are responding to your question can more easily see what the issue might be.</p>
163
+ <p>This gem uses <a href="WWWJDic.html"><code>WWWJDic</code></a> Backdoor Entry/API as described by <a href="http://www.edrdg.org/wwwjdic/wwwjdicinf.html#backdoor_tag">www.edrdg.org/wwwjdic/wwwjdicinf.html#backdoor_tag</a> to interact with <a href="WWWJDic.html"><code>WWWJDic</code></a> and translate to and from Japanese language.</p>
193
164
 
194
- <h3 id="label-Contributing">Contributing<span><a href="#label-Contributing">&para;</a> <a href="#top">&uarr;</a></span></h3>
165
+ <p><a href="WWWJDic.html"><code>WWWJDic</code></a> is an online Japanese translation server made by Jim Breen and available at <a href="http://www.edrdg.org/cgi-bin/wwwjdic/wwwjdic?1C">www.edrdg.org/cgi-bin/wwwjdic/wwwjdic?1C</a>.</p>
195
166
 
196
- <p>If you&#39;ve found a bug, want to submit a patch, or have a feature request, please enter a ticket into our bug tracker: <code>https://savannah.nongnu.org/bugs/?func=additem&group=wwwjdic</code></p>
167
+ <p>Jim Breen&#39;s Japanese Page lists this gem: <a href="http://nihongo.monash.edu/japanese.html#links_software">nihongo.monash.edu/japanese.html#links_software</a> and has allowed the use of the same name.</p>
197
168
 
198
- <p>We strongly encourage bug reports to come with failing tests or at least a reduced example that demonstrates the problem.</p>
169
+ <p>GNU GPLv3 license; source code available through anonymous checkout: <code>hg clone http://hg.savannah.nongnu.org/hgweb/wwwjdic/</code> or write me, and I&#39;ll send it.</p>
199
170
 
200
- <p>Similarly, patches should include tests, API documentation, and an update to the manual where relevant. Feel free to clone early though and participate in the project, if you just want some feedback or a code review before preparing your code to be merged.</p>
171
+ <p>You can even decide to contribute to this little free software project by registering to Savannah and ask to be part of the <code>wwwjdic</code> project!</p>
201
172
 
202
- <p>If you are unsure about whether or not you&#39;ve found a bug, or want to check to see whether we&#39;d be interested in the feature you want to add before you start working on it, feel free to post to our mailing list.</p>
173
+ <p>With great contributions from: Jim Breen, 新部裕, Jon Maken.</p>
203
174
 
204
- <h3 id="label-License">License<span><a href="#label-License">&para;</a> <a href="#top">&uarr;</a></span></h3>
175
+ <h2 id="label-Install">Install<span><a href="#label-Install">&para;</a> <a href="#top">&uarr;</a></span></h2>
205
176
 
206
- <p><a href="WWWJDic.html"><code>WWWJDic</code></a> is released under GNU GPL v3 license: if you wish to contribute to <a href="WWWJDic.html"><code>WWWJDic</code></a>, you will retain your own <a href="copyright_md.html">copyright</a> but must agree to license your code under the same terms as the project itself (or any compatible license according to <a href="http://www.gnu.org/licenses/license-list.en.html#GPLCompatibleLicenses">GPL Compatible Licenses</a>).</p>
177
+ <p>RubyGems is the preferred easy install method for <a href="WWWJDic.html"><code>WWWJDic</code></a>. <a href="WWWJDic.html"><code>WWWJDic</code></a> should be installed via the <a href="http://rubyforge.org/projects/rubygems/">RubyGems</a> system. To get the latest version, simply enter the following into your command prompt: <code>gem install wwwjdic</code>.</p>
207
178
 
208
- <h3 id="label-Links">Links<span><a href="#label-Links">&para;</a> <a href="#top">&uarr;</a></span></h3>
179
+ <p>Because <a href="WWWJDic.html"><code>WWWJDic</code></a> is pure Ruby, it should run pretty much anywhere, including Rubinius, JRuby, MacRuby, etc. Officially the support is for &gt;= 3.0 MJIT.</p>
209
180
 
210
181
  <h4 id="label-Savannah">Savannah<span><a href="#label-Savannah">&para;</a> <a href="#top">&uarr;</a></span></h4>
211
182
  <ul><li>
@@ -229,118 +200,281 @@ with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
229
200
  <p>Gem updates Atom Feed: <a href="https://rubygems.org/gems/wwwjdic/versions.atom">rubygems.org/gems/wwwjdic/versions.atom</a></p>
230
201
  </li></ul>
231
202
 
232
- <h4 id="label-Other+links">Other links<span><a href="#label-Other+links">&para;</a> <a href="#top">&uarr;</a></span></h4>
233
- <ul><li>
234
- <p>WWWJDic: <a href="http://www.edrdg.org/cgi-bin/wwwjdic/wwwjdic?1C">www.edrdg.org/cgi-bin/wwwjdic/wwwjdic?1C</a> .</p>
235
- </li><li>
236
- <p>Jim Breen&#39;s Japanese Page: <a href="http://nihongo.monash.edu/japanese.html#links_software">nihongo.monash.edu/japanese.html#links_software</a></p>
237
- </li><li>
238
- <p>“An HTTP/HTTPS/FTP file downloader library/CLI based upon MiniPortile&#39;s HTTP implementation.” gist by Jon Maken: <a href="https://gist.github.com/jonforums/2202048">gist.github.com/jonforums/2202048</a>.</p>
239
- </li></ul>
203
+ <h2 id="label-Usage">Usage<span><a href="#label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>
204
+
205
+ <p>See <code>examples</code> folder. To run the examples just run <code>ruby</code>{EXAMPLE_NAME}<code>.rb</code>. Running the examples you&#39;ll see both the example description and correct code usage to perform such action. Here below there are the currently available examples: * The <code>basics.rb</code> example (run <code>ruby examples/basics.rb</code>) shows how to initialize and use a <a href="WWWJDic.html"><code>WWWJDic</code></a> object through the <code>breener</code> factory method; * The <code>uri.rb</code> example (run <code>ruby examples/uri.rb</code>) shows how to ask for different types of translation URIs at <a href="WWWJDic.html"><code>WWWJDic</code></a>, with all available options and configurations. * The <code>translate.rb</code> example (run <code>ruby examples/translate.rb</code>) shows how to ask for an actual translation through <a href="WWWJDic.html"><code>WWWJDic</code></a> Backdoor/API, with all available options and configurations. It will also show how to download such translation;</p>
240
206
 
241
- <h3 id="label-Usage+Examples">Usage Examples<span><a href="#label-Usage+Examples">&para;</a> <a href="#top">&uarr;</a></span></h3>
207
+ <p>Using this API is pretty simple. First, remember that this API maintains a context, so you can save your preferred configuration of server, dictionary, output formats, … by assigning those value to your object. Get a reference to the <a href="WWWJDic.html"><code>WWWJDic</code></a> object, through its factory method, with <code>my_wwwjdic = WWWJDic::breener</code>. This will save a <a href="WWWJDic.html"><code>WWWJDic</code></a> instance in your <code>my_wwwjdic</code> object. At this point the object does contain a default configuration in terms of dictionary, server, …</p>
242
208
 
243
- <p>See <code>examples</code> folder. To run the examples just run <code>ruby examples/</code>{EXAMPLE_NAME}<code>.rb</code>. Running the examples you&#39;ll see both the example description and correct code usage to perform such action. Here below are listed the currently available examples:</p>
209
+ <p>You can take a look at the current status/configuration of your <code>my_wwwjdic</code> object using the <code>dictionary</code> method <code>my_wwwjdic.dictionary</code> that shows the dictionary currently in use (default is <code>Jpn-Eng General (EDICT)</code>), or using the <code>server</code> method <code>my_wwwjdic.server</code> that shows the dictionary server currently in use (default is <code>http://www.edrdg.org/cgi-bin/wwwjdic/wwwjdic.cgi?</code>).</p>
244
210
  <ul><li>
245
- <p>The <code>basics.rb</code> example (run <code>ruby examples/basics.rb</code>) shows how to initialize and use a <a href="WWWJDic.html"><code>WWWJDic</code></a> object through the <code>breener</code> factory method;</p>
246
- </li><li>
247
- <p>The <code>uri.rb</code> example (run <code>ruby examples/uri.rb</code>) shows how to ask for translation URI at <a href="WWWJDic.html"><code>WWWJDic</code></a>, with all available options and configurations.</p>
248
- </li><li>
249
- <p>The <code>translate.rb</code> example (run <code>ruby examples/translate.rb</code>) shows how to ask for an actual translation through <a href="WWWJDic.html"><code>WWWJDic</code></a> Backdoor/API, with all available options and configurations. It will also show how to download such translation;</p>
211
+ <p><code>dictionary</code>: you can set your own dictionary through the same <code>dictionary</code> method, by assigning it one of the available dictionaries, either using the dictionary number, or the (exact) dictionary name.</p>
250
212
  </li></ul>
251
213
 
252
- <p>Using this API is pretty simple. First, get a reference to the <a href="WWWJDic.html"><code>WWWJDic</code></a> object, through its factory method with</p>
253
-
254
- <pre class="ruby"><span class="ruby-identifier">my_wwwjdic</span> = <span class="ruby-constant">WWWJDic</span><span class="ruby-operator">::</span><span class="ruby-identifier">breener</span>
255
- </pre>
256
-
257
- <p>This will save a <a href="WWWJDic.html"><code>WWWJDic</code></a> instance in your <code>my_wwwjdic</code> object.</p>
258
-
259
- <h4 id="label-Parameters">Parameters<span><a href="#label-Parameters">&para;</a> <a href="#top">&uarr;</a></span></h4>
260
-
261
- <p>You can then start possibly manipulating some basic parameters that can be set and read from the API. These are not mandatory settings, but are useful whether you&#39;ll use your <code>my_wwwjdic</code> object for further similar requests: settings these values internally will save you type more parameters in the request, leaving only the word to search/translate as needed.</p>
214
+ <p>| Number | Dictionary Name | |:——:|—————————| | 1 | Jpn-Eng General (EDICT) | | 2 | Japanese Names (ENAMDICT) | | 3 | Computing/Telecomms | | 4 | Life Sciences/Bio-Med | | 5 | Legal Terms | | 6 | Finance/Marketing | | 7 | Buddhism | | 8 | Miscellaneous | | 9 | Special Text-glossing | | A | Engineering/Science | | B | Linguistics | | C | River &amp; Water Systems | | D | Automobile Industry | | E | Japanese Wordnet | | F | Work-in-progress File | | G | Japanese-German (WaDoku) | | H | Japanese-French | | I | Japanese-Russian | | J | Japanese-Swedish | | K | Japanese-Hungarian | | L | Japanese-Spanish | | M | Japanese-Dutch | | N | Japanese-Slovenian | | O | Japanese-Italian | | P | Untranslated | | Q | Combined Jpn-Eng | | R | Expanded Text-glossing |</p>
215
+
216
+ <p>For example, with <code>my_wwwjdic.dictionary = &#39;7&#39;</code> you set the <code>Buddhism</code> dictionary or with <code>my_wwwjdic.dictionary = &#39;Japanese Wordnet&#39;</code> you just set the <code>Japanese Wordnet</code> one. Your <code>my_wwwjdic</code> object saves and maintains these values unless reset. * <code>server</code>: you can set your own server through the same <code>server</code> method, by assigning it one of the available servers. Using <code>my_wwwjdic.server = :edrdg</code> the library will use the main (default) URL at <a href="http://www.edrdg.org/cgi-bin/wwwjdic/wwwjdic.cgi">www.edrdg.org/cgi-bin/wwwjdic/wwwjdic.cgi</a>? for the dictionary server while instead using <code>my_wwwjdic.server = :monash</code> will use the URL <a href="http://nihongo.monash.edu/cgi-bin/wwwjdic">nihongo.monash.edu/cgi-bin/wwwjdic</a>? that relays on Monash University mirror. * <code>uri</code>: you can ask for a translation reference URL; that is not a translation by itself, but it&#39;s the full URL where to find the translation. * You can get the translation URL of a specific word using the command <code>my_wwwjdic.uri &#39;</code>word<code>&#39;</code> that returns the normal URL. * Then you can use the <code>my_wwwjdic.raw_uri &#39;</code>word<code>&#39;</code>, for the raw display format. The raw dictionary display option is useful for calls from other programs, smartphones, etc. It omits all header and footer information from the pages, and displays the unedited dictionary entries in EDICT and KANJIDIC format, one-per-line and encapsulated by &lt;pre&gt; … &lt;/pre&gt;. In this option the output is always in UTF-8 coding. * the <code>my_wwwjdic.json_uri &#39;</code>word<code>&#39;</code> command, instead, returns the URL for translation of <code>word</code> in a JSON format as <code>{ &quot;</code>word<code>: &quot;</code>url<code>&quot; }</code> with normal display format. * <code>translate</code>: you can, finaly, obviously ask for a specific translation using the configured parameters. * you can get a simple translation with the command <code>my_wwwjdic.translate &#39;word&#39;</code>, that returns a string containing the web page content of the translation of <code>word</code> in the raw display format. It&#39;s equivalent to <code>my_wwwjdic.translate &#39;word&#39;, display: :raw</code>. * <code>my_wwwjdic.translate &#39;word&#39;, nil, filename</code>, regardless the <code>nil</code> (see it later), the third <code>filename</code> parameter is the name of the file where the translation will be saved into. Specifying this <code>filename</code> parameter, the translation will not be shown, but it will be saved in the specified file. * Another possible result for translation is to get it in JSON format also with the possibility to save it in a file: <code>my_wwwjdic.json_translate &#39;word&#39;</code>, returns the JSON format of the translation: * The JSON will contain a field having the same name of the word to be translated that contains the URL of the translation from the reference dictionary server used. The URL is exatcly the same used to retrieve the translation and filling the resulting JSON. * The <code>title</code> field will contain the title of the translation page result. * The <code>translation</code> field will contain the raw translation as received from the server. * The <code>message</code> field will contain all the text that will possibly be included as error message in the translation. This means that if any <code>&lt;p&gt;</code> tag encloses some text, such text will be presented in this <code>message</code> field. * The <code>lines</code> field will contain an array of all the lines of the translation, that is: the <code>lines</code> field contains a split of the <code>translation</code> field using its existing <code>\n</code> characters. * The <code>content</code> field contains an array of JSON objects, each containing the formatted translation of each line: * a field with the name of the word asked for translation, containing the actual translation, first field of the translation in each line; * a <code>kana</code> field with the kana writing for the translation, as shown in brackets, in each line; * a <code>text</code> field containing the explanation associated to such translation; * a <code>meanings</code> field containing the different meaning associated to each line. The <code>/</code> characters mark the splitting point for each line.</p>
217
+
218
+ <pre>So, basically, the JSON will contain the whole raw translation, the
219
+ same translation split into different lines, when asked by the
220
+ translation itself, and each of those lines above split again into a
221
+ set of available meanings.
222
+
223
+ For the example translation above, the resulting JSON format is:
224
+ ```json5
225
+ {
226
+ &quot;word&quot;: &quot;http://www.edrdg.org/cgi-bin/wwwjdic/wwwjdic.cgi?1ZDQword&quot;,
227
+ &quot;title&quot;: &quot;WWWJDIC: Word Display&quot;,
228
+ &quot;translation&quot;: &quot;伝言 [つてこと] /(n) (1) (See 伝言・でんごん) verbal message/word (from someone)/(n) (2) rumour/rumor/\n伝言 [でんごん] /(n,vs) verbal message/word (from someone)/(P)/\n一議 [いちぎ] /(n) word (opinion, objection)/\n言の葉 [ことのは;ことのえ] /(n) (1) (arch) word/(n) (2) (See 和歌) waka (classic Japanese poem, esp. a tanka)/\nワード /(n) (1) word/(n) (2) {comp} word/(n) (3) {comp} Word/Microsoft Word/(P)/\n語 [ご] /(n,n-suf) (1) language/(n,n-suf,ctr) (2) word/(P)/\n単語 [たんご] /(n,adj-no) {ling} word/vocabulary/(usually) single-character word/(P)/\n訪れ [おとずれ] /(n) (1) visit/call/(n) (2) arrival (e.g. of spring)/advent/coming/appearance/(n) (3) news/tidings/word/(P)/\n音沙汰;音さた [おとさた] /(n) news (from someone)/word/contact/\n言 [げん(P);こと] /(n) word/remark/statement/(P)/\n知らせ(P);報せ [しらせ] /(n) (1) (See お知らせ) news/word/tidings/notice/notification/information/(n) (2) omen/(P)/\n言葉(P);詞;辞 [ことば(P);けとば(言葉)(ok)] /(n) (1) (See 言語) language/dialect/(n) (2) (See 単語) word/words/phrase/term/expression/remark/(n) (3) speech/(manner of) speaking/(n) (4) learning to speak/language acquisition/(P)/&quot;,
229
+ &quot;message&quot;: null,
230
+ &quot;lines&quot;: [
231
+ &quot;伝言 [つてこと] /(n) (1) (See 伝言・でんごん) verbal message/word (from someone)/(n) (2) rumour/rumor/&quot;,
232
+ &quot;伝言 [でんごん] /(n,vs) verbal message/word (from someone)/(P)/&quot;,
233
+ &quot;一議 [いちぎ] /(n) word (opinion, objection)/&quot;,
234
+ &quot;言の葉 [ことのは;ことのえ] /(n) (1) (arch) word/(n) (2) (See 和歌) waka (classic Japanese poem, esp. a tanka)/&quot;,
235
+ &quot;ワード /(n) (1) word/(n) (2) {comp} word/(n) (3) {comp} Word/Microsoft Word/(P)/&quot;,
236
+ &quot;語 [ご] /(n,n-suf) (1) language/(n,n-suf,ctr) (2) word/(P)/&quot;,
237
+ &quot;単語 [たんご] /(n,adj-no) {ling} word/vocabulary/(usually) single-character word/(P)/&quot;,
238
+ &quot;訪れ [おとずれ] /(n) (1) visit/call/(n) (2) arrival (e.g. of spring)/advent/coming/appearance/(n) (3) news/tidings/word/(P)/&quot;,
239
+ &quot;音沙汰;音さた [おとさた] /(n) news (from someone)/word/contact/&quot;,
240
+ &quot;言 [げん(P);こと] /(n) word/remark/statement/(P)/&quot;,
241
+ &quot;知らせ(P);報せ [しらせ] /(n) (1) (See お知らせ) news/word/tidings/notice/notification/information/(n) (2) omen/(P)/&quot;,
242
+ &quot;言葉(P);詞;辞 [ことば(P);けとば(言葉)(ok)] /(n) (1) (See 言語) language/dialect/(n) (2) (See 単語) word/words/phrase/term/expression/remark/(n) (3) speech/(manner of) speaking/(n) (4) learning to speak/language acquisition/(P)/&quot;
243
+ ],
244
+ &quot;content&quot;: [
245
+ {
246
+ &quot;word&quot;: &quot;伝言&quot;,
247
+ &quot;kana&quot;: &quot;つてこと&quot;,
248
+ &quot;text&quot;: &quot;(n)(1) (See 伝言・でんごん) verbal message/word (from someone)/(n) (2) rumour/rumor&quot;,
249
+ &quot;meanings&quot;: [
250
+ &quot;(n) (1) (See 伝言・でんごん) verbal message&quot;,
251
+ &quot;word (from someone)&quot;,
252
+ &quot;(n) (2) rumour&quot;,
253
+ &quot;rumor&quot;
254
+ ]
255
+ },
256
+ {
257
+ &quot;word&quot;: &quot;伝言&quot;,
258
+ &quot;kana&quot;: &quot;でんごん&quot;,
259
+ &quot;text&quot;: &quot;(n,vs) verbal message/word (from someone)/(P)&quot;,
260
+ &quot;meanings&quot;: [
261
+ &quot;(n,vs) verbal message&quot;,
262
+ &quot;word (from someone)&quot;,
263
+ &quot;(P)&quot;
264
+ ]
265
+ },
266
+ {
267
+ &quot;word&quot;: &quot;一議&quot;,
268
+ &quot;kana&quot;: &quot;いちぎ&quot;,
269
+ &quot;text&quot;: &quot;(n) word (opinion, objection)&quot;
270
+ },
271
+ {
272
+ &quot;word&quot;: &quot;言の葉&quot;,
273
+ &quot;kana&quot;: &quot;ことのは;ことのえ&quot;,
274
+ &quot;text&quot;: &quot;(n) (1) (arch) word/(n) (2) (See 和歌) waka (classic Japanese poem, esp. a tanka)&quot;,
275
+ &quot;meanings&quot;: [
276
+ &quot;(n) (1) (arch) word&quot;,
277
+ &quot;(n) (2) (See 和歌) waka (classic Japanese poem, esp. a tanka)&quot;
278
+ ]
279
+ },
280
+ {
281
+ &quot;kana&quot;: &quot;ワード&quot;,
282
+ &quot;word&quot;: &quot;ワード&quot;,
283
+ &quot;text&quot;: &quot;(n) (1) word/(n) (2) {comp} word/(n) (3) {comp} Word/Microsoft Word/(P)&quot;,
284
+ &quot;meanings&quot;: [
285
+ &quot;(n) (1) word&quot;,
286
+ &quot;(n) (2) {comp} word&quot;,
287
+ &quot;(n) (3) {comp} Word&quot;,
288
+ &quot;Microsoft Word&quot;,
289
+ &quot;(P)&quot;
290
+ ]
291
+ },
292
+ {
293
+ &quot;word&quot;: &quot;語&quot;,
294
+ &quot;kana&quot;: &quot;ご&quot;,
295
+ &quot;text&quot;: &quot;(n,n-suf) (1) language/(n,n-suf,ctr) (2) word/(P)&quot;,
296
+ &quot;meanings&quot;: [
297
+ &quot;(n,n-suf) (1) language&quot;,
298
+ &quot;(n,n-suf,ctr) (2) word&quot;,
299
+ &quot;(P)&quot;
300
+ ]
301
+ },
302
+ {
303
+ &quot;word&quot;: &quot;単語&quot;,
304
+ &quot;kana&quot;: &quot;たんご&quot;,
305
+ &quot;text&quot;: &quot;(n,adj-no) {ling} word/vocabulary/(usually) single-character word/(P)&quot;,
306
+ &quot;meanings&quot;: [
307
+ &quot;(n,adj-no) {ling} word&quot;,
308
+ &quot;vocabulary&quot;,
309
+ &quot;(usually) single-character word&quot;,
310
+ &quot;(P)&quot;
311
+ ]
312
+ },
313
+ {
314
+ &quot;word&quot;: &quot;訪れ&quot;,
315
+ &quot;kana&quot;: &quot;おとずれ&quot;,
316
+ &quot;text&quot;: &quot;(n) (1) visit/call/(n) (2) arrival (e.g. of spring)/advent/coming/appearance/(n) (3) news/tidings/word/(P)&quot;,
317
+ &quot;meanings&quot;: [
318
+ &quot;(n) (1) visit&quot;,
319
+ &quot;call&quot;,
320
+ &quot;(n) (2) arrival (e.g. of spring)&quot;,
321
+ &quot;advent&quot;,
322
+ &quot;coming&quot;,
323
+ &quot;appearance&quot;,
324
+ &quot;(n) (3) news&quot;,
325
+ &quot;tidings&quot;,
326
+ &quot;word&quot;,
327
+ &quot;(P)&quot;
328
+ ]
329
+ },
330
+ {
331
+ &quot;word&quot;: &quot;音沙汰;音さた&quot;,
332
+ &quot;kana&quot;: &quot;おとさた&quot;,
333
+ &quot;text&quot;: &quot;(n) news (from someone)/word/contact&quot;,
334
+ &quot;meanings&quot;: [
335
+ &quot;(n) news (from someone)&quot;,
336
+ &quot;word&quot;,
337
+ &quot;contact&quot;
338
+ ]
339
+ },
340
+ {
341
+ &quot;word&quot;: &quot;言&quot;,
342
+ &quot;kana&quot;: &quot;げん(P);こと&quot;,
343
+ &quot;text&quot;: &quot;(n) word/remark/statement/(P)&quot;,
344
+ &quot;meanings&quot;: [
345
+ &quot;(n) word&quot;,
346
+ &quot;remark&quot;,
347
+ &quot;statement&quot;,
348
+ &quot;(P)&quot;
349
+ ]
350
+ },
351
+ {
352
+ &quot;word&quot;: &quot;知らせ(P);報せ&quot;,
353
+ &quot;kana&quot;: &quot;しらせ&quot;,
354
+ &quot;text&quot;: &quot;(n) (1) (See お知らせ) news/word/tidings/notice/notification/information/(n) (2) omen/(P)&quot;,
355
+ &quot;meanings&quot;: [
356
+ &quot;(n) (1) (See お知らせ) news&quot;,
357
+ &quot;word&quot;,
358
+ &quot;tidings&quot;,
359
+ &quot;notice&quot;,
360
+ &quot;notification&quot;,
361
+ &quot;information&quot;,
362
+ &quot;(n) (2) omen&quot;,
363
+ &quot;(P)&quot;
364
+ ]
365
+ },
366
+ {
367
+ &quot;word&quot;: &quot;言葉(P);詞;辞&quot;,
368
+ &quot;kana&quot;: &quot;ことば(P);けとば(言葉)(ok)&quot;,
369
+ &quot;text&quot;: &quot;(n) (1) (See 言語) language/dialect/(n) (2) (See 単語) word/words/phrase/term/expression/remark/(n) (3) speech/(manner of) speaking/(n) (4) learning to speak/language acquisition/(P)&quot;,
370
+ &quot;meanings&quot;: [
371
+ &quot;(n) (1) (See 言語) language&quot;,
372
+ &quot;dialect&quot;,
373
+ &quot;(n) (2) (See 単語) word&quot;,
374
+ &quot;words&quot;,
375
+ &quot;phrase&quot;,
376
+ &quot;term&quot;,
377
+ &quot;expression&quot;,
378
+ &quot;remark&quot;,
379
+ &quot;(n) (3) speech&quot;,
380
+ &quot;(manner of) speaking&quot;,
381
+ &quot;(n) (4) learning to speak&quot;,
382
+ &quot;language acquisition&quot;,
383
+ &quot;(P)&quot;
384
+ ]
385
+ }
386
+ ]
387
+ }
388
+ ```
389
+ Please note that the resulting JSON is not pretty-printed, as shown
390
+ here.</pre>
262
391
  <ul><li>
263
- <p>the <code>server</code> name/URL to use:</p>
264
-
265
- <pre class="ruby"><span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">server</span> <span class="ruby-comment"># returns the default server URL http://www.csse.monash.edu.au/~jwb/cgi-bin/wwwjdic.cgi?</span>
266
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-comment"># contains the URL above</span>
267
-
268
- <span class="ruby-comment"># this below is (again) the default configured server</span>
269
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">server</span> = <span class="ruby-value">:edrdg</span>
270
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">server</span> <span class="ruby-comment"># returns the URL http://www.edrdg.org/cgi-bin/wwwjdic/wwwjdic.cgi?</span>
271
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-comment"># contains the URL above</span>
272
-
273
- <span class="ruby-comment"># this is the additional server</span>
274
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">server</span> = <span class="ruby-value">:monash</span>
275
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">server</span> <span class="ruby-comment"># returns the URL http://www.csse.monash.edu.au/~jwb/cgi-bin/wwwjdic.cgi?</span>
276
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-comment"># contains the URL above</span>
277
- </pre>
278
- </li><li>
279
- <p>the default reference <code>dictionary</code> to use for translations. All currently available dictionaries strings can be used: <code>&#39;1&#39;</code>, <code>&#39;2&#39;</code>, <code>&#39;3&#39;</code>, <code>&#39;4&#39;</code>, <code>&#39;5&#39;</code>, <code>&#39;6&#39;</code>, <code>&#39;7&#39;</code>, <code>&#39;8&#39;</code>, <code>&#39;9&#39;</code>, <code>&#39;A&#39;</code>, <code>&#39;B&#39;</code>, <code>&#39;C&#39;</code>, <code>&#39;D&#39;</code>, <code>&#39;E&#39;</code>, <code>&#39;F&#39;</code>, <code>&#39;G&#39;</code>, <code>&#39;H&#39;</code>, <code>&#39;I&#39;</code>, <code>&#39;J&#39;</code>, <code>&#39;K&#39;</code>, <code>&#39;L&#39;</code>, <code>&#39;M&#39;</code>, <code>&#39;N&#39;</code>, <code>&#39;O&#39;</code>, <code>&#39;P&#39;</code>, <code>&#39;Q&#39;</code> and <code>&#39;R&#39;</code>. You can even use the whole (exact) dictionary strings as listed in the <a href="WWWJDic.html"><code>WWWJDic</code></a> HTML source code: <code>&#39;Jpn-Eng General (EDICT)&#39;</code>, <code>&#39;Japanese Names (ENAMDICT)&#39;</code>, <code>&#39;Computing/Telecomms&#39;</code>, <code>&#39;Life Sciences/Bio-Med&#39;</code>, <code>&#39;Legal Terms&#39;</code>, <code>&#39;Finance/Marketing&#39;</code>, <code>&#39;Buddhism&#39;</code>, <code>&#39;Miscellaneous&#39;</code>, <code>&#39;Special Text-glossing&#39;</code>, <code>&#39;Engineering/Science&#39;</code>, <code>&#39;Linguistics&#39;</code>, <code>&#39;River &amp; Water Systems&#39;</code>, <code>&#39;Automobile Industry&#39;</code>, <code>&#39;Japanese Wordnet&#39;</code>, <code>&#39;Work-in-progress File&#39;</code>, <code>&#39;Japanese-German (WaDoku)&#39;</code>, <code>&#39;Japanese-French&#39;</code>, <code>&#39;Japanese-Russian&#39;</code>, <code>&#39;Japanese-Swedish&#39;</code>, <code>&#39;Japanese-Hungarian&#39;</code>, <code>&#39;Japanese-Spanish&#39;</code>, <code>&#39;Japanese-Dutch&#39;</code>, <code>&#39;Japanese-Slovenian&#39;</code>, <code>&#39;Japanese-Italian&#39;</code>, <code>&#39;Untranslated&#39;</code>, <code>&#39;Combined Jpn-Eng&#39;</code>, <code>&#39;Expanded Text-glossing&#39;</code>.</p>
392
+ <p>Now let&#39;s come to the second parameter of the methods above (set to <code>nil</code> in the examples), the arguments for the translation. The default is to translate to/from English/Japanese with normal display layout and no other specificities, except that the API automatically identifies Japanese or English and manages the romaji and so on. The returned URL is the default EDR&amp;DG one, as required by Jim Breen himself. What if the user wants to customize something? The <code>args</code>, second parameter of all those methods above, is a dictionary (hash map) that allows specifying which parameters and to which values they shall be set.</p>
393
+ </li></ul>
280
394
 
281
- <pre class="ruby"><span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">dictionary</span> <span class="ruby-comment"># returns 0 as default, if not set</span>
395
+ <p>Valid parameters, and their values are: * <code>dict</code> parameter allows both numbers and (exact) strings to select dictionaries:</p>
396
+
397
+ <pre> | Number | Dictionary Name |
398
+ |:------:|---------------------------|
399
+ | 1 | Jpn-Eng General (EDICT) |
400
+ | 2 | Japanese Names (ENAMDICT) |
401
+ | 3 | Computing/Telecomms |
402
+ | 4 | Life Sciences/Bio-Med |
403
+ | 5 | Legal Terms |
404
+ | 6 | Finance/Marketing |
405
+ | 7 | Buddhism |
406
+ | 8 | Miscellaneous |
407
+ | 9 | Special Text-glossing |
408
+ | A | Engineering/Science |
409
+ | B | Linguistics |
410
+ | C | River &amp; Water Systems |
411
+ | D | Automobile Industry |
412
+ | E | Japanese Wordnet |
413
+ | F | Work-in-progress File |
414
+ | G | Japanese-German (WaDoku) |
415
+ | H | Japanese-French |
416
+ | I | Japanese-Russian |
417
+ | J | Japanese-Swedish |
418
+ | K | Japanese-Hungarian |
419
+ | L | Japanese-Spanish |
420
+ | M | Japanese-Dutch |
421
+ | N | Japanese-Slovenian |
422
+ | O | Japanese-Italian |
423
+ | P | Untranslated |
424
+ | Q | Combined Jpn-Eng |
425
+ | R | Expanded Text-glossing |
426
+
427
+ * `display` parameter to select the final format of the referred
428
+ HTML page (either regular HTML or raw): `:regular`, `:raw`.
429
+ * `server` allows the user to select from the default URL (at
430
+ Electronic Dictionaries R&amp;D Group) or the Monash university URL:
431
+ `:edrdg`, `:monash`.</pre>
432
+
433
+ <p>Some examples of these parameters&#39; usage: * <code>my_wwwjdic.translate &#39;Sprache&#39;, dict: &#39;G&#39;, key: english</code>, this translates using the <code>F</code> dictionary, that is the German one * <code>my_wwwjdic.uri &#39;Sprache&#39;, dict: &#39;G&#39;</code>, same as above, but returns the translation URL, instead * <code>my_wwwjdic.raw_uri &#39;Sprache&#39;, dict: &#39;G&#39;</code>, same as above, but returns the translation URL with raw display, instead * <code>my_wwwjdic.uri &#39;Sprache&#39;, dict: &#39;G&#39;, display: raw</code></p>
434
+
435
+ <h2 id="label-Maintainers">Maintainers<span><a href="#label-Maintainers">&para;</a> <a href="#top">&uarr;</a></span></h2>
436
+ <ul><li>
437
+ <p><a href="https://savannah.nongnu.org/users/marcobresciani">Marco Bresciani</a></p>
438
+ </li></ul>
282
439
 
283
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">dictionary</span> = <span class="ruby-string">&#39;7&#39;</span>
284
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">dictionary</span> <span class="ruby-comment"># returns the string &#39;7&#39;</span>
285
- </pre>
440
+ <h2 id="label-Thanks">Thanks<span><a href="#label-Thanks">&para;</a> <a href="#top">&uarr;</a></span></h2>
441
+ <ul><li>
442
+ <p><em>Contributor</em>: <a href="http://www.csse.monash.edu.au/~jwb/index.html">Jim Breen</a></p>
286
443
  </li><li>
287
- <p>Then you can obviously ask for a translation reference URL. Basic examples:</p>
444
+ <p><em>Author</em>: <a href="mailto:jon.forums@gmail.com">Jon Maken</a>, <a href="https://gist.github.com/jonforums/2202048">An HTTP/HTTPS/FTP file downloader library/CLI based upon MiniPortile’s HTTP implementation.</a> About <em>An HTTP/HTTPS/FTP file downloader library/CLI based upon MiniPortile&#39;s HTTP implementation</em>, please note that “License: 3-clause BSD”. This license is GNU GPLv3 compatible according to <a href="http://www.gnu.org/licenses/license-list.en.html#ModifiedBSD">www.gnu.org/licenses/license-list.en.html#ModifiedBSD</a>.</p>
445
+ </li></ul>
288
446
 
289
- <pre class="ruby"><span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">uri</span> <span class="ruby-string">&#39;word&#39;</span> <span class="ruby-comment"># this return the URL for translation of &#39;word&#39;, with normal display format</span>
447
+ <p>FSIJ理事会の理事長、<a href="mailto:gniibe@fsij.org">新部裕</a>さんの日本語の翻訳。 Japanese translation by <a href="mailto:gniibe@fsij.org">Yutaka Niibe</a>, President of Free Software Initiative of Japan.</p>
290
448
 
291
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">raw_uri</span> <span class="ruby-string">&#39;word&#39;</span> <span class="ruby-comment"># this return the URL for translation of &#39;word&#39;, with raw display format</span>
449
+ <p>Thanks to Łukasz Niemier for his suggestions on possible improvements.</p>
292
450
 
293
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">json_uri</span> <span class="ruby-string">&#39;word&#39;</span> <span class="ruby-comment"># this return the URL for translation of &#39;word&#39;, returning a JSON data as { &#39;word&#39;: &#39;url&#39; } with normal display format</span>
294
- </pre>
295
- </li><li>
296
- <p>Then, instead of the pure URL to reference the <a href="WWWJDic.html"><code>WWWJDic</code></a> site, you can retrieve the actual translation itself or save it to a file:</p>
451
+ <h2 id="label-Contributing">Contributing<span><a href="#label-Contributing">&para;</a> <a href="#top">&uarr;</a></span></h2>
297
452
 
298
- <pre class="ruby"><span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">translate</span> <span class="ruby-string">&#39;word&#39;</span> <span class="ruby-comment"># returns a string containing the web page content of the raw display format</span>
453
+ <p><a href="WWWJDic.html"><code>WWWJDic</code></a> tries to follow semantic versioning (see <a href="http://semver.org">semver.org</a>/). There may be backward incompatible changes each time minor version number changes, but that any tiny version number change should be bug fixes and internal changes only. Be sure to read the <code>CHANGELOG</code> each time we cut a new release and lock your gems accordingly.</p>
299
454
 
300
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">translate</span> <span class="ruby-string">&#39;word&#39;</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">filename</span> <span class="ruby-comment"># regardless the nil (see it later) the third parameter is the filename where to save the retrieved translation</span>
301
- </pre>
302
- </li><li>
303
- <p>Another possible result for translation is to get it in JSON format also with the possibility to save it in a file.</p>
455
+ <p>RDoc documentation available in the <code>html</code> folder.</p>
304
456
 
305
- <pre class="ruby"><span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">json_translate</span> <span class="ruby-string">&#39;word&#39;</span> <span class="ruby-comment"># returns the JSON format of the translation.</span>
306
- </pre>
457
+ <p>The easiest way to get help with <a href="WWWJDic.html"><code>WWWJDic</code></a> is to post a message to the mailing list: <code>http://lists.nongnu.org/mailman/listinfo/wwwjdic-users</code></p>
307
458
 
308
- <p>For this, the resulting JSON format will be:</p>
459
+ <p>Feel free to post any question there, developers are responsive and will be happy to help you figure out how to use <a href="WWWJDic.html"><code>WWWJDic</code></a>, or help you determine whether it&#39;s the right tool for the task you are working on.</p>
309
460
 
310
- <pre>{
311
- word : translation uri for raw display format
312
- &#39;title&#39; : title (extracted from &lt;br&gt;TITLE&lt;br&gt; tags in raw display format)
313
- &#39;translation&#39; : translation content (extracted from &lt;pre&gt;TRANSLATION&lt;/pre&gt; raw display format
314
- &#39;message&#39; : possible error message or result (extracted from &lt;p&gt;MESSAGE\n raw display format
315
- }</pre>
316
- </li><li>
317
- <p>Now let&#39;s come to the second parameter of the methods above (set to <code>nil</code> in the examples), the arguments for the translation. The default is to translate to/from English/Japanese with normal display layout and no other specificities, except that the API automatically identifies Japanese or English and manages the romaji and so on. The returned URL is the default EDR&amp;DG one. What if the user wants to customize something? The <code>args</code>, second parameter of all those methods above, is a dictionary (hash map) that allows to specify which parameters and to which values they shall be set.</p>
461
+ <p>Please make your posts to the list as specific as possible, including code samples and output where relevant. Do not post any information that should not be shared publicly, and be sure to reduce your example code as much as possible so that those who are responding to your question can more easily see what the issue might be.</p>
318
462
 
319
- <p>Valid parameters, and their values are:</p>
320
- <ul><li>
321
- <p><code>dict</code> parameter allows both numbers and (exact) strings to select dictionaries: <code>&#39;1&#39;</code>, <code>&#39;2&#39;</code>, <code>&#39;3&#39;</code>, <code>&#39;4&#39;</code>, <code>&#39;5&#39;</code>, <code>&#39;6&#39;</code>, <code>&#39;7&#39;</code>, <code>&#39;8&#39;</code>, <code>&#39;9&#39;</code>, <code>&#39;A&#39;</code>, <code>&#39;B&#39;</code>, <code>&#39;C&#39;</code>, <code>&#39;D&#39;</code>, <code>&#39;E&#39;</code>, <code>&#39;F&#39;</code>, <code>&#39;G&#39;</code>, <code>&#39;H&#39;</code>, <code>&#39;I&#39;</code>, <code>&#39;J&#39;</code>, <code>&#39;K&#39;</code>, <code>&#39;L&#39;</code>, <code>&#39;M&#39;</code>, <code>&#39;N&#39;</code>, <code>&#39;O&#39;</code>, <code>&#39;P&#39;</code>, <code>&#39;Q&#39;</code>, and <code>&#39;R&#39;</code>, together with the full (exact) strings <code>&#39;Jpn-Eng General (EDICT)&#39;</code>, <code>&#39;Japanese Names (ENAMDICT)&#39;</code>, <code>&#39;Computing/Telecomms&#39;</code>, <code>&#39;Life Sciences/Bio-Med&#39;</code>, <code>&#39;Legal Terms&#39;</code>, <code>&#39;Finance/Marketing&#39;</code>, <code>&#39;Buddhism&#39;</code>, <code>&#39;Miscellaneous&#39;</code>, <code>&#39;Special Text-glossing&#39;</code>, <code>&#39;Engineering/Science&#39;</code>, <code>&#39;Linguistics&#39;</code>, <code>&#39;River &amp; Water Systems&#39;</code>, <code>&#39;Automobile Industry&#39;</code>, <code>&#39;Japanese Wordnet&#39;</code>, <code>&#39;Work-in-progress File&#39;</code>, <code>&#39;Japanese-German (WaDoku)&#39;</code>, <code>&#39;Japanese-French&#39;</code>, <code>&#39;Japanese-Russian&#39;</code>, <code>&#39;Japanese-Swedish&#39;</code>, <code>&#39;Japanese-Hungarian&#39;</code>, <code>&#39;Japanese-Spanish&#39;</code>, <code>&#39;Japanese-Dutch&#39;</code>, <code>&#39;Japanese-Slovenian&#39;</code>, <code>&#39;Japanese-Italian&#39;</code>, <code>&#39;Untranslated&#39;</code>, <code>&#39;Combined Jpn-Eng&#39;</code> and <code>&#39;Expanded Text-glossing&#39;</code>.</p>
322
- </li><li>
323
- <p><code>display</code> parameter to select the final format of the referred HTML page (either regular HTML or raw): <code>:regular</code>, <code>:raw</code>.</p>
324
- </li><li>
325
- <p><code>server</code> allows the user to select from the default URL (at Electronic Dictionaries R&amp;D Group) or the Monash university URL: <code>:edrdg</code>, <code>:monash</code>.</p>
326
- </li></ul>
463
+ <p>If you&#39;ve found a bug, want to submit a patch, or have a feature request, please enter a ticket into our bug tracker: <code>https://savannah.nongnu.org/bugs/?func=additem&amp;group=wwwjdic</code></p>
327
464
 
328
- <p>Some examples of these parameters&#39; usage:</p>
465
+ <p>We strongly encourage adding bug reports with failing tests or at least a reduced example that demonstrates the problem.</p>
329
466
 
330
- <pre class="ruby"> <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">translate</span> <span class="ruby-string">&#39;sprache&#39;</span>, <span class="ruby-value">dict:</span> <span class="ruby-string">&#39;F&#39;</span> <span class="ruby-comment"># this translates using the &#39;F&#39; dictionary, that is the German one</span>
467
+ <p>Similarly, patches should include tests, API documentation, and an update to the manual where relevant. Feel free to clone early though and participate in the project, if you just want some feedback, or a code review before preparing your code to be merged.</p>
331
468
 
332
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">uri</span> <span class="ruby-string">&#39;sprache&#39;</span>, <span class="ruby-value">dict:</span> <span class="ruby-string">&#39;F&#39;</span> <span class="ruby-comment"># same as above, but returns the translation URL, instead</span>
469
+ <p>If you are unsure about whether you&#39;ve found a bug, or want to check to see whether we&#39;d be interested in the feature you want to add before you start working on it, feel free to post to our mailing list.</p>
333
470
 
334
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">raw_uri</span> <span class="ruby-string">&#39;sprache&#39;</span>, <span class="ruby-value">dict:</span> <span class="ruby-string">&#39;F&#39;</span> <span class="ruby-comment"># same as above, but returns the translation URL with raw display, instead</span>
471
+ <h2 id="label-License">License<span><a href="#label-License">&para;</a> <a href="#top">&uarr;</a></span></h2>
335
472
 
336
- <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">uri</span> <span class="ruby-string">&#39;sprache&#39;</span>, <span class="ruby-value">dict:</span> <span class="ruby-string">&#39;F&#39;</span>, <span class="ruby-value">display:</span> <span class="ruby-identifier">raw</span> <span class="ruby-comment"># same as above</span>
337
- </pre>
338
- </li></ul>
339
- <hr>
473
+ <p>SPDX-FileCopyrightText: 2014 Marco Bresciani</p>
340
474
 
341
- <p>wwwjdic</p>
475
+ <p>SPDX-License-Identifier: GFDL-1.3-or-later</p>
342
476
 
343
- <p>Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani</p>
477
+ <p>(C) 2014 Marco Bresciani</p>
344
478
 
345
479
  <p>This file is part of wwwjdic.</p>
346
480
 
@@ -350,14 +484,11 @@ with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
350
484
 
351
485
  <p>You should have received a copy of the GNU General Public License along with wwwjdic. If not, see <a href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.</p>
352
486
 
353
-
354
487
  </main>
355
488
 
356
489
 
357
-
358
490
  <footer id="validator-badges" role="contentinfo">
359
491
  <p><a href="https://validator.w3.org/check/referer">Validate</a>
360
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
492
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.2.
361
493
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
362
494
  </footer>
363
-