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