iciba 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/iciba/fanyi.rb +2 -1
- data/lib/iciba/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -23,8 +23,8 @@ Command-line usage:
|
|
23
23
|
$ fy 'words to be translated'
|
24
24
|
$ fy 'english' # for single word answers
|
25
25
|
$ fy 'english' -e #for complete definition if available
|
26
|
+
$ fy 'You will need to have root access to do this.' -p #to get pinyin for chinese characters, (hopefully fy.iciba.com is correct)
|
26
27
|
$ fy http://www.chinadaily.com.cn/business/2012-09/07/content_15742188.htm -l #to download links
|
27
|
-
$ fy http://www.chinadaily.com.cn/business/2012-09/07/content_15742188.htm -l -r #to translate the links TODO
|
28
28
|
|
29
29
|
Ruby usage:
|
30
30
|
|
data/lib/iciba/fanyi.rb
CHANGED
@@ -16,7 +16,8 @@ module Iciba
|
|
16
16
|
puts '------------------------------------------------------------------------------------' if bin
|
17
17
|
download_and_parse(words, dir, extended)
|
18
18
|
puts wrap_text(self.result) if bin
|
19
|
-
puts
|
19
|
+
puts if self.result.contains_cjk? && bin
|
20
|
+
puts wrap_text(self.result.strip.gsub("\r\n", '|newline|').to_pinyin.gsub('|newline|', "\r\n\r\n"), 40) if self.result.contains_cjk? && bin
|
20
21
|
puts '------------------------------------------------------------------------------------' if bin
|
21
22
|
return self.result
|
22
23
|
end
|
data/lib/iciba/version.rb
CHANGED