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.
- checksums.yaml +7 -0
- data/CHANGELOG +419 -0
- data/COPYING.md +675 -0
- data/Gemfile +21 -0
- data/README.md +303 -0
- data/Rakefile +52 -0
- data/acknowledgements.md +55 -0
- data/authors.md +67 -0
- data/copyright.md +377 -0
- data/examples/basics.rb +117 -0
- data/examples/translate.rb +128 -0
- data/examples/uri.rb +129 -0
- data/html/CHANGELOG.html +597 -0
- data/html/COPYING_md.html +389 -0
- data/html/Gemfile.html +104 -0
- data/html/Object.html +185 -0
- data/html/README_md.html +343 -0
- data/html/Rakefile.html +137 -0
- data/html/WWWJDic/ParsableDuckType.html +159 -0
- data/html/WWWJDic/Parser.html +233 -0
- data/html/WWWJDic/Parsers/Dict.html +191 -0
- data/html/WWWJDic/Parsers/Display.html +184 -0
- data/html/WWWJDic/Parsers/Key.html +221 -0
- data/html/WWWJDic/Parsers/Search.html +214 -0
- data/html/WWWJDic/Parsers/Server.html +182 -0
- data/html/WWWJDic/Parsers.html +96 -0
- data/html/WWWJDic/Splitter.html +378 -0
- data/html/WWWJDic/Utils/Downloader/Downloader.html +227 -0
- data/html/WWWJDic/Utils/Downloader.html +108 -0
- data/html/WWWJDic/Utils/Raisers.html +235 -0
- data/html/WWWJDic/Utils.html +108 -0
- data/html/WWWJDic/WWWJDic.html +715 -0
- data/html/WWWJDic.html +348 -0
- data/html/acknowledgements_md.html +149 -0
- data/html/authors_md.html +181 -0
- data/html/copyright_md.html +422 -0
- data/html/created.rid +59 -0
- data/html/css/fonts.css +167 -0
- data/html/css/rdoc.css +590 -0
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +363 -0
- data/html/js/darkfish.js +161 -0
- data/html/js/jquery.js +4 -0
- data/html/js/navigation.js +141 -0
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +109 -0
- data/html/js/search_index.js +1 -0
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +229 -0
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +541 -0
- data/html/wwwjdic_gemspec.html +161 -0
- data/lib/wwwjdic/application.rb +233 -0
- data/lib/wwwjdic/constants.rb +113 -0
- data/lib/wwwjdic/locales/de.yml +29 -0
- data/lib/wwwjdic/locales/en.yml +29 -0
- data/lib/wwwjdic/locales/es.yml +29 -0
- data/lib/wwwjdic/locales/fr.yml +29 -0
- data/lib/wwwjdic/locales/hu.yml +29 -0
- data/lib/wwwjdic/locales/it.yml +29 -0
- data/lib/wwwjdic/locales/ja.yml +30 -0
- data/lib/wwwjdic/locales/nl.yml +29 -0
- data/lib/wwwjdic/locales/ru.yml +29 -0
- data/lib/wwwjdic/locales/sl.yml +29 -0
- data/lib/wwwjdic/locales/sv.yml +29 -0
- data/lib/wwwjdic/parser.rb +46 -0
- data/lib/wwwjdic/parsers/dict.rb +58 -0
- data/lib/wwwjdic/parsers/display.rb +50 -0
- data/lib/wwwjdic/parsers/key.rb +75 -0
- data/lib/wwwjdic/parsers/search.rb +60 -0
- data/lib/wwwjdic/parsers/server.rb +47 -0
- data/lib/wwwjdic/utils/downloader.rb +135 -0
- data/lib/wwwjdic/utils/raisers.rb +67 -0
- data/lib/wwwjdic/utils/splitter.rb +84 -0
- data/lib/wwwjdic/version.rb +20 -0
- data/lib/wwwjdic.rb +57 -0
- data/test/test_helper.rb +40 -0
- data/test/test_wwwjdic.rb +32 -0
- data/test/wwwjdic/locales/de.yml +22 -0
- data/test/wwwjdic/locales/en.yml +22 -0
- data/test/wwwjdic/locales/es.yml +22 -0
- data/test/wwwjdic/locales/fr.yml +22 -0
- data/test/wwwjdic/locales/hu.yml +22 -0
- data/test/wwwjdic/locales/it.yml +21 -0
- data/test/wwwjdic/locales/ja.yml +23 -0
- data/test/wwwjdic/locales/nl.yml +22 -0
- data/test/wwwjdic/locales/ru.yml +22 -0
- data/test/wwwjdic/locales/sl.yml +22 -0
- data/test/wwwjdic/locales/sv.yml +22 -0
- data/test/wwwjdic/locales/test_locales.rb +65 -0
- data/test/wwwjdic/parsers/test_dict.rb +73 -0
- data/test/wwwjdic/parsers/test_display.rb +51 -0
- data/test/wwwjdic/parsers/test_key.rb +52 -0
- data/test/wwwjdic/parsers/test_server.rb +51 -0
- data/test/wwwjdic/test_application.rb +219 -0
- data/test/wwwjdic/test_parsable_duck_type.rb +37 -0
- data/test/wwwjdic/utils/test_downloader.rb +41 -0
- data/test/wwwjdic/utils/test_raisers.rb +59 -0
- data/wwwjdic.gemspec +74 -0
- metadata +309 -0
data/html/Object.html
ADDED
@@ -0,0 +1,185 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Object - 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">BasicObject
|
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="WWWJDic/ParsableDuckType.html">WWWJDic::ParsableDuckType</a>
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<li><a class="include" href="WWWJDic/Utils/Raisers.html">WWWJDic::Utils::Raisers</a>
|
78
|
+
|
79
|
+
|
80
|
+
</ul>
|
81
|
+
</div>
|
82
|
+
|
83
|
+
|
84
|
+
<!-- Method Quickref -->
|
85
|
+
<div id="method-list-section" class="nav-section">
|
86
|
+
<h3>Methods</h3>
|
87
|
+
|
88
|
+
<ul class="link-list" role="directory">
|
89
|
+
|
90
|
+
<li ><a href="#method-i-load_yaml_file">#load_yaml_file</a>
|
91
|
+
|
92
|
+
</ul>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
</nav>
|
97
|
+
|
98
|
+
<main role="main" aria-labelledby="class-Object">
|
99
|
+
<h1 id="class-Object" class="class">
|
100
|
+
class Object
|
101
|
+
</h1>
|
102
|
+
|
103
|
+
<section class="description">
|
104
|
+
|
105
|
+
</section>
|
106
|
+
|
107
|
+
|
108
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
<section class="constants-list">
|
115
|
+
<header>
|
116
|
+
<h3>Constants</h3>
|
117
|
+
</header>
|
118
|
+
<dl>
|
119
|
+
|
120
|
+
<dt id="RELATIVE_PATH">RELATIVE_PATH
|
121
|
+
|
122
|
+
<dd>
|
123
|
+
|
124
|
+
|
125
|
+
</dl>
|
126
|
+
</section>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
133
|
+
<header>
|
134
|
+
<h3>Public Instance Methods</h3>
|
135
|
+
</header>
|
136
|
+
|
137
|
+
|
138
|
+
<div id="method-i-load_yaml_file" class="method-detail ">
|
139
|
+
|
140
|
+
<div class="method-heading">
|
141
|
+
<span class="method-name">load_yaml_file</span><span
|
142
|
+
class="method-args">(locale)</span>
|
143
|
+
|
144
|
+
<span class="method-click-advice">click to toggle source</span>
|
145
|
+
|
146
|
+
</div>
|
147
|
+
|
148
|
+
|
149
|
+
<div class="method-description">
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<div class="method-source-code" id="load_yaml_file-source">
|
157
|
+
<pre> <span class="ruby-comment"># File test/wwwjdic/locales/test_locales.rb</span>
|
158
|
+
<span class="line-num">45</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_yaml_file</span>(<span class="ruby-identifier">locale</span>)
|
159
|
+
<span class="line-num">46</span> <span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-identifier">dirname</span>(<span class="ruby-keyword">__FILE__</span>), <span class="ruby-constant">RELATIVE_PATH</span>, <span class="ruby-node">"#{locale}.yml"</span>)
|
160
|
+
<span class="line-num">47</span> <span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-identifier">expand_path</span> <span class="ruby-identifier">filename</span>
|
161
|
+
<span class="line-num">48</span> <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-identifier">open</span> <span class="ruby-node">"#{filename}"</span>)
|
162
|
+
<span class="line-num">49</span> <span class="ruby-keyword">end</span></pre>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
</div>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
</div>
|
171
|
+
|
172
|
+
|
173
|
+
</section>
|
174
|
+
|
175
|
+
</section>
|
176
|
+
|
177
|
+
</main>
|
178
|
+
|
179
|
+
|
180
|
+
<footer id="validator-badges" role="contentinfo">
|
181
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
182
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
|
183
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
184
|
+
</footer>
|
185
|
+
|
data/html/README_md.html
ADDED
@@ -0,0 +1,343 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>README - 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="file">
|
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
|
+
<div class="nav-section">
|
57
|
+
<h3>Table of Contents</h3>
|
58
|
+
|
59
|
+
<ul class="link-list" role="directory">
|
60
|
+
<li><a href="#label-WWWJDic">WWWJDic</a>
|
61
|
+
<li><a href="#label-Description">Description</a>
|
62
|
+
<li><a href="#label-Documentation">Documentation</a>
|
63
|
+
<li><a href="#label-Installing+WWWJDic">Installing WWWJDic</a>
|
64
|
+
<li><a href="#label-Supported+Ruby+Versions+and+Implementations">Supported Ruby Versions and Implementations</a>
|
65
|
+
<li><a href="#label-Support">Support</a>
|
66
|
+
<li><a href="#label-Contributing">Contributing</a>
|
67
|
+
<li><a href="#label-License">License</a>
|
68
|
+
<li><a href="#label-Links">Links</a>
|
69
|
+
<li><a href="#label-Savannah">Savannah</a>
|
70
|
+
<li><a href="#label-RubyGems">RubyGems</a>
|
71
|
+
<li><a href="#label-Other+links">Other links</a>
|
72
|
+
<li><a href="#label-Usage+Examples">Usage Examples</a>
|
73
|
+
<li><a href="#label-Parameters">Parameters</a>
|
74
|
+
</ul>
|
75
|
+
</div>
|
76
|
+
|
77
|
+
|
78
|
+
<div id="project-metadata">
|
79
|
+
<div id="fileindex-section" class="nav-section">
|
80
|
+
<h3>Pages</h3>
|
81
|
+
|
82
|
+
<ul class="link-list">
|
83
|
+
|
84
|
+
<li><a href="./CHANGELOG.html">CHANGELOG</a>
|
85
|
+
|
86
|
+
<li><a href="./COPYING_md.html">COPYING</a>
|
87
|
+
|
88
|
+
<li><a href="./Gemfile.html">Gemfile</a>
|
89
|
+
|
90
|
+
<li><a href="./README_md.html">README</a>
|
91
|
+
|
92
|
+
<li><a href="./Rakefile.html">Rakefile</a>
|
93
|
+
|
94
|
+
<li><a href="./acknowledgements_md.html">acknowledgements</a>
|
95
|
+
|
96
|
+
<li><a href="./authors_md.html">authors</a>
|
97
|
+
|
98
|
+
<li><a href="./copyright_md.html">copyright</a>
|
99
|
+
|
100
|
+
<li><a href="./wwwjdic_gemspec.html">wwwjdic.gemspec</a>
|
101
|
+
|
102
|
+
</ul>
|
103
|
+
</div>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
</nav>
|
107
|
+
|
108
|
+
<main role="main" aria-label="Page README.md">
|
109
|
+
<!--
|
110
|
+
wwwjdic
|
111
|
+
|
112
|
+
Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani
|
113
|
+
|
114
|
+
This file is part of wwwjdic.
|
115
|
+
|
116
|
+
wwwjdic is free software: you can redistribute it and/or modify it under
|
117
|
+
the terms of the GNU General Public License as published by the Free
|
118
|
+
Software Foundation, either version 3 of the License, or (at your
|
119
|
+
option) any later version.
|
120
|
+
|
121
|
+
wwwjdic is distributed in the hope that it will be useful, but WITHOUT
|
122
|
+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
123
|
+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
124
|
+
more details.
|
125
|
+
|
126
|
+
You should have received a copy of the GNU General Public License along
|
127
|
+
with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
|
128
|
+
-->
|
129
|
+
<h1 id="label-WWWJDic"><a href="WWWJDic.html"><code>WWWJDic</code></a><span><a href="#label-WWWJDic">¶</a> <a href="#top">↑</a></span></h1>
|
130
|
+
|
131
|
+
<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>
|
132
|
+
|
133
|
+
<p>Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani</p>
|
134
|
+
|
135
|
+
<p>This file is part of wwwjdic.</p>
|
136
|
+
|
137
|
+
<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>
|
138
|
+
|
139
|
+
<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>
|
140
|
+
|
141
|
+
<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>
|
142
|
+
|
143
|
+
<h2 id="label-Description">Description<span><a href="#label-Description">¶</a> <a href="#top">↑</a></span></h2>
|
144
|
+
|
145
|
+
<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>
|
146
|
+
|
147
|
+
<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>
|
148
|
+
|
149
|
+
<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'll send it.</p>
|
150
|
+
|
151
|
+
<p>You can even decide to contribute to this little free software project by registering to Savannah and ask to be part of the 'WWWJDic' project! With contributions from: Jim Breen, 新部裕, Jon Maken.</p>
|
152
|
+
|
153
|
+
<h2 id="label-Documentation">Documentation<span><a href="#label-Documentation">¶</a> <a href="#top">↑</a></span></h2>
|
154
|
+
|
155
|
+
<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>
|
156
|
+
|
157
|
+
<p>RDoc documentation available in the html folder.</p>
|
158
|
+
|
159
|
+
<h3 id="label-Installing+WWWJDic">Installing <a href="WWWJDic.html"><code>WWWJDic</code></a><span><a href="#label-Installing+WWWJDic">¶</a> <a href="#top">↑</a></span></h3>
|
160
|
+
|
161
|
+
<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>
|
162
|
+
|
163
|
+
<h3 id="label-Supported+Ruby+Versions+and+Implementations">Supported Ruby Versions and Implementations<span><a href="#label-Supported+Ruby+Versions+and+Implementations">¶</a> <a href="#top">↑</a></span></h3>
|
164
|
+
|
165
|
+
<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>
|
166
|
+
|
167
|
+
<h3 id="label-Support">Support<span><a href="#label-Support">¶</a> <a href="#top">↑</a></span></h3>
|
168
|
+
|
169
|
+
<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>
|
170
|
+
|
171
|
+
<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's the right tool for the task you are working on.</p>
|
172
|
+
|
173
|
+
<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>
|
174
|
+
|
175
|
+
<h3 id="label-Contributing">Contributing<span><a href="#label-Contributing">¶</a> <a href="#top">↑</a></span></h3>
|
176
|
+
|
177
|
+
<p>If you'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>
|
178
|
+
|
179
|
+
<p>We strongly encourage bug reports to come with failing tests or at least a reduced example that demonstrates the problem.</p>
|
180
|
+
|
181
|
+
<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>
|
182
|
+
|
183
|
+
<p>If you are unsure about whether or not you've found a bug, or want to check to see whether we'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>
|
184
|
+
|
185
|
+
<h3 id="label-License">License<span><a href="#label-License">¶</a> <a href="#top">↑</a></span></h3>
|
186
|
+
|
187
|
+
<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>
|
188
|
+
|
189
|
+
<h3 id="label-Links">Links<span><a href="#label-Links">¶</a> <a href="#top">↑</a></span></h3>
|
190
|
+
|
191
|
+
<h4 id="label-Savannah">Savannah<span><a href="#label-Savannah">¶</a> <a href="#top">↑</a></span></h4>
|
192
|
+
<ul><li>
|
193
|
+
<p>Project page: <a href="https://savannah.nongnu.org/projects/wwwjdic">savannah.nongnu.org/projects/wwwjdic</a>/</p>
|
194
|
+
</li><li>
|
195
|
+
<p>Source code (Mercurial) repository: <a href="http://hg.savannah.gnu.org/hgweb/wwwjdic">hg.savannah.gnu.org/hgweb/wwwjdic</a>/</p>
|
196
|
+
</li><li>
|
197
|
+
<p>Known Bugs: <a href="https://savannah.nongnu.org/bugs/?group=wwwjdic">savannah.nongnu.org/bugs/?group=wwwjdic</a></p>
|
198
|
+
</li><li>
|
199
|
+
<p>Users Mailing List: <a href="https://savannah.nongnu.org/mail/?group=wwwjdic">savannah.nongnu.org/mail/?group=wwwjdic</a></p>
|
200
|
+
</li><li>
|
201
|
+
<p>News: <a href="https://savannah.nongnu.org/news/?group=wwwjdic">savannah.nongnu.org/news/?group=wwwjdic</a></p>
|
202
|
+
</li></ul>
|
203
|
+
|
204
|
+
<h4 id="label-RubyGems">RubyGems<span><a href="#label-RubyGems">¶</a> <a href="#top">↑</a></span></h4>
|
205
|
+
<ul><li>
|
206
|
+
<p>Gem page: <a href="https://rubygems.org/gems/wwwjdic">rubygems.org/gems/wwwjdic</a></p>
|
207
|
+
</li><li>
|
208
|
+
<p>Online RDoc: <a href="http://rubydoc.info/gems/wwwjdic">rubydoc.info/gems/wwwjdic</a>/</p>
|
209
|
+
</li><li>
|
210
|
+
<p>Gem updates Atom Feed: <a href="https://rubygems.org/gems/wwwjdic/versions.atom">rubygems.org/gems/wwwjdic/versions.atom</a></p>
|
211
|
+
</li></ul>
|
212
|
+
|
213
|
+
<h4 id="label-Other+links">Other links<span><a href="#label-Other+links">¶</a> <a href="#top">↑</a></span></h4>
|
214
|
+
<ul><li>
|
215
|
+
<p>WWWJDic: <a href="http://www.edrdg.org/cgi-bin/wwwjdic/wwwjdic?1C">www.edrdg.org/cgi-bin/wwwjdic/wwwjdic?1C</a> .</p>
|
216
|
+
</li><li>
|
217
|
+
<p>Jim Breen's Japanese Page: <a href="http://nihongo.monash.edu/japanese.html#links_software">nihongo.monash.edu/japanese.html#links_software</a></p>
|
218
|
+
</li><li>
|
219
|
+
<p>“An HTTP/HTTPS/FTP file downloader library/CLI based upon MiniPortile's HTTP implementation.” gist by Jon Maken: <a href="https://gist.github.com/jonforums/2202048">gist.github.com/jonforums/2202048</a>.</p>
|
220
|
+
</li></ul>
|
221
|
+
|
222
|
+
<h3 id="label-Usage+Examples">Usage Examples<span><a href="#label-Usage+Examples">¶</a> <a href="#top">↑</a></span></h3>
|
223
|
+
|
224
|
+
<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'll see both the example description and correct code usage to perform such action. Here below are listed the currently available examples:</p>
|
225
|
+
<ul><li>
|
226
|
+
<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>
|
227
|
+
</li><li>
|
228
|
+
<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>
|
229
|
+
</li><li>
|
230
|
+
<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>
|
231
|
+
</li></ul>
|
232
|
+
|
233
|
+
<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>
|
234
|
+
|
235
|
+
<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>
|
236
|
+
</pre>
|
237
|
+
|
238
|
+
<p>This will save a <a href="WWWJDic.html"><code>WWWJDic</code></a> instance in your <code>my_wwwjdic</code> object.</p>
|
239
|
+
|
240
|
+
<h4 id="label-Parameters">Parameters<span><a href="#label-Parameters">¶</a> <a href="#top">↑</a></span></h4>
|
241
|
+
|
242
|
+
<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'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>
|
243
|
+
<ul><li>
|
244
|
+
<p>the <code>server</code> name/URL to use:</p>
|
245
|
+
|
246
|
+
<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>
|
247
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-comment"># contains the URL above</span>
|
248
|
+
|
249
|
+
<span class="ruby-comment"># this below is (again) the default configured server</span>
|
250
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">server</span> = <span class="ruby-value">:edrdg</span>
|
251
|
+
<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>
|
252
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-comment"># contains the URL above</span>
|
253
|
+
|
254
|
+
<span class="ruby-comment"># this is the additional server</span>
|
255
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">server</span> = <span class="ruby-value">:monash</span>
|
256
|
+
<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>
|
257
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-comment"># contains the URL above</span>
|
258
|
+
</pre>
|
259
|
+
</li><li>
|
260
|
+
<p>the default reference <code>dictionary</code> to use for translations. All currently available dictionaries strings can be used: <code>'1'</code>, <code>'2'</code>, <code>'3'</code>, <code>'4'</code>, <code>'5'</code>, <code>'6'</code>, <code>'7'</code>, <code>'8'</code>, <code>'9'</code>, <code>'A'</code>, <code>'B'</code>, <code>'C'</code>, <code>'D'</code>, <code>'E'</code>, <code>'F'</code>, <code>'G'</code>, <code>'H'</code>, <code>'I'</code>, <code>'J'</code>, <code>'K'</code>, <code>'L'</code>, <code>'M'</code>, <code>'N'</code>, <code>'O'</code>, <code>'P'</code>, <code>'Q'</code> and <code>'R'</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>'Jpn-Eng General (EDICT)'</code>, <code>'Japanese Names (ENAMDICT)'</code>, <code>'Computing/Telecomms'</code>, <code>'Life Sciences/Bio-Med'</code>, <code>'Legal Terms'</code>, <code>'Finance/Marketing'</code>, <code>'Buddhism'</code>, <code>'Miscellaneous'</code>, <code>'Special Text-glossing'</code>, <code>'Engineering/Science'</code>, <code>'Linguistics'</code>, <code>'River & Water Systems'</code>, <code>'Automobile Industry'</code>, <code>'Japanese Wordnet'</code>, <code>'Work-in-progress File'</code>, <code>'Japanese-German (WaDoku)'</code>, <code>'Japanese-French'</code>, <code>'Japanese-Russian'</code>, <code>'Japanese-Swedish'</code>, <code>'Japanese-Hungarian'</code>, <code>'Japanese-Spanish'</code>, <code>'Japanese-Dutch'</code>, <code>'Japanese-Slovenian'</code>, <code>'Japanese-Italian'</code>, <code>'Untranslated'</code>, <code>'Combined Jpn-Eng'</code>, <code>'Expanded Text-glossing'</code>.</p>
|
261
|
+
|
262
|
+
<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>
|
263
|
+
|
264
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">dictionary</span> = <span class="ruby-string">'7'</span>
|
265
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">dictionary</span> <span class="ruby-comment"># returns the string '7'</span>
|
266
|
+
</pre>
|
267
|
+
</li><li>
|
268
|
+
<p>Then you can obviously ask for a translation reference URL. Basic examples:</p>
|
269
|
+
|
270
|
+
<pre class="ruby"><span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">uri</span> <span class="ruby-string">'word'</span> <span class="ruby-comment"># this return the URL for translation of 'word', with normal display format</span>
|
271
|
+
|
272
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">raw_uri</span> <span class="ruby-string">'word'</span> <span class="ruby-comment"># this return the URL for translation of 'word', with raw display format</span>
|
273
|
+
|
274
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">json_uri</span> <span class="ruby-string">'word'</span> <span class="ruby-comment"># this return the URL for translation of 'word', returning a JSON data as { 'word': 'url' } with normal display format</span>
|
275
|
+
</pre>
|
276
|
+
</li><li>
|
277
|
+
<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>
|
278
|
+
|
279
|
+
<pre class="ruby"><span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">translate</span> <span class="ruby-string">'word'</span> <span class="ruby-comment"># returns a string containing the web page content of the raw display format</span>
|
280
|
+
|
281
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">translate</span> <span class="ruby-string">'word'</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>
|
282
|
+
</pre>
|
283
|
+
</li><li>
|
284
|
+
<p>Another possible result for translation is to get it in JSON format also with the possibility to save it in a file.</p>
|
285
|
+
|
286
|
+
<pre class="ruby"><span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">json_translate</span> <span class="ruby-string">'word'</span> <span class="ruby-comment"># returns the JSON format of the translation.</span>
|
287
|
+
</pre>
|
288
|
+
|
289
|
+
<p>For this, the resulting JSON format will be:</p>
|
290
|
+
|
291
|
+
<pre>{
|
292
|
+
word : translation uri for raw display format
|
293
|
+
'title' : title (extracted from <br>TITLE<br> tags in raw display format)
|
294
|
+
'translation' : translation content (extracted from <pre>TRANSLATION</pre> raw display format
|
295
|
+
'message' : possible error message or result (extracted from <p>MESSAGE\n raw display format
|
296
|
+
}</pre>
|
297
|
+
</li><li>
|
298
|
+
<p>Now let'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&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>
|
299
|
+
|
300
|
+
<p>Valid parameters, and their values are:</p>
|
301
|
+
<ul><li>
|
302
|
+
<p><code>dict</code> parameter allows both numbers and (exact) strings to select dictionaries: <code>'1'</code>, <code>'2'</code>, <code>'3'</code>, <code>'4'</code>, <code>'5'</code>, <code>'6'</code>, <code>'7'</code>, <code>'8'</code>, <code>'9'</code>, <code>'A'</code>, <code>'B'</code>, <code>'C'</code>, <code>'D'</code>, <code>'E'</code>, <code>'F'</code>, <code>'G'</code>, <code>'H'</code>, <code>'I'</code>, <code>'J'</code>, <code>'K'</code>, <code>'L'</code>, <code>'M'</code>, <code>'N'</code>, <code>'O'</code>, <code>'P'</code>, <code>'Q'</code>, and <code>'R'</code>, together with the full (exact) strings <code>'Jpn-Eng General (EDICT)'</code>, <code>'Japanese Names (ENAMDICT)'</code>, <code>'Computing/Telecomms'</code>, <code>'Life Sciences/Bio-Med'</code>, <code>'Legal Terms'</code>, <code>'Finance/Marketing'</code>, <code>'Buddhism'</code>, <code>'Miscellaneous'</code>, <code>'Special Text-glossing'</code>, <code>'Engineering/Science'</code>, <code>'Linguistics'</code>, <code>'River & Water Systems'</code>, <code>'Automobile Industry'</code>, <code>'Japanese Wordnet'</code>, <code>'Work-in-progress File'</code>, <code>'Japanese-German (WaDoku)'</code>, <code>'Japanese-French'</code>, <code>'Japanese-Russian'</code>, <code>'Japanese-Swedish'</code>, <code>'Japanese-Hungarian'</code>, <code>'Japanese-Spanish'</code>, <code>'Japanese-Dutch'</code>, <code>'Japanese-Slovenian'</code>, <code>'Japanese-Italian'</code>, <code>'Untranslated'</code>, <code>'Combined Jpn-Eng'</code> and <code>'Expanded Text-glossing'</code>.</p>
|
303
|
+
</li><li>
|
304
|
+
<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>
|
305
|
+
</li><li>
|
306
|
+
<p><code>server</code> allows the user to select from the default URL (at Electronic Dictionaries R&D Group) or the Monash university URL: <code>:edrdg</code>, <code>:monash</code>.</p>
|
307
|
+
</li></ul>
|
308
|
+
|
309
|
+
<p>Some examples of these parameters' usage:</p>
|
310
|
+
|
311
|
+
<pre class="ruby"> <span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">translate</span> <span class="ruby-string">'sprache'</span>, <span class="ruby-value">dict:</span> <span class="ruby-string">'F'</span> <span class="ruby-comment"># this translates using the 'F' dictionary, that is the German one</span>
|
312
|
+
|
313
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">uri</span> <span class="ruby-string">'sprache'</span>, <span class="ruby-value">dict:</span> <span class="ruby-string">'F'</span> <span class="ruby-comment"># same as above, but returns the translation URL, instead</span>
|
314
|
+
|
315
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">raw_uri</span> <span class="ruby-string">'sprache'</span>, <span class="ruby-value">dict:</span> <span class="ruby-string">'F'</span> <span class="ruby-comment"># same as above, but returns the translation URL with raw display, instead</span>
|
316
|
+
|
317
|
+
<span class="ruby-identifier">my_wwwjdic</span>.<span class="ruby-identifier">uri</span> <span class="ruby-string">'sprache'</span>, <span class="ruby-value">dict:</span> <span class="ruby-string">'F'</span>, <span class="ruby-value">display:</span> <span class="ruby-identifier">raw</span> <span class="ruby-comment"># same as above</span>
|
318
|
+
</pre>
|
319
|
+
</li></ul>
|
320
|
+
<hr>
|
321
|
+
|
322
|
+
<p>wwwjdic</p>
|
323
|
+
|
324
|
+
<p>Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani</p>
|
325
|
+
|
326
|
+
<p>This file is part of wwwjdic.</p>
|
327
|
+
|
328
|
+
<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>
|
329
|
+
|
330
|
+
<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>
|
331
|
+
|
332
|
+
<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>
|
333
|
+
|
334
|
+
</main>
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
<footer id="validator-badges" role="contentinfo">
|
339
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
340
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
|
341
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
342
|
+
</footer>
|
343
|
+
|