class WWWJDic::Parsers::Search
This class is an implementation of the Parsable duck type that checks the display type. The only needed parameter is the word to translate.
t is the search type:
-
for dictionary lookups use:
-
D where the lookup text is in ASCII, EUC, ISO-2022-JP or UCS
-
(the old uxxxx format);
* S where the lookup text is in Shift-JIS; * U where the lookup text is in UTF-8.
-
for kanji lookups use:
-
K for all lookups via codes, codepoints, etc. or where the
-
text string (e.g. kanji or reading) is in EUC;
* M for all lookups using a text string in UTF8; * N for all lookups using a text string in Shift_JIS;
-
for text glossing/translate words in text use:
-
G where the text is in EUC, ISO-2022-JP or UCS;
-
H where the text is in Shift-JIS;
-
I where the text is in UTF-8.
-
-
for multi-radical kanji lookups use:
-
B where the text is in EUC, ISO-2022-JP or UCS;
-
C where the text is in Shift-JIS;
-
F where the text is in UTF-8.
-
-
for example sentence lookups via indexed Japanese words, use E.
-
for example sentence lookups using a regular expression, use T.
- Author
- Copyright
-
© 2014-2021 Marco Bresciani
- License
-
GNU General Public License version 3
Public Instance Methods
The parsable duck type interface to every parser usage.
# File lib/wwwjdic/parsers/search.rb 60 def parse(value = '') 61 return 'D' if value == CGI.escape(value).to_s 62 63 'U' 64 end