iciba 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -3
- data/bin/fy +1 -0
- data/lib/iciba/fanyi.rb +3 -3
- data/lib/iciba/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -22,13 +22,14 @@ Command-line usage:
|
|
22
22
|
|
23
23
|
$ fy 'words to be translated'
|
24
24
|
$ fy 'english' # for single word answers
|
25
|
-
$ fy 'english' -e for complete definition if available
|
26
|
-
$ fy
|
25
|
+
$ fy 'english' -e #for complete definition if available
|
26
|
+
$ 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
|
27
28
|
|
28
29
|
Ruby usage:
|
29
30
|
|
30
31
|
require 'iciba'
|
31
|
-
Iciba::Fanyi.new('words to be translated')
|
32
|
+
Iciba::Fanyi.new('words to be translated').result
|
32
33
|
|
33
34
|
## Contributing
|
34
35
|
|
data/bin/fy
CHANGED
data/lib/iciba/fanyi.rb
CHANGED
@@ -8,8 +8,8 @@ module Iciba
|
|
8
8
|
def initialize(words, dir='auto', bin=false, extended=false)
|
9
9
|
puts '------------------------------------------------------------------------------------' if bin
|
10
10
|
# puts if bingit
|
11
|
-
puts wrap_text(words, 40) if
|
12
|
-
puts wrap_text(words) unless
|
11
|
+
puts wrap_text(words, 40) if words.contains_cjk? && bin
|
12
|
+
puts wrap_text(words) unless words.contains_cjk? && bin
|
13
13
|
puts '------------------------------------------------------------------------------------' if bin
|
14
14
|
download_and_parse(words, dir, extended)
|
15
15
|
puts wrap_text(self.result) if bin
|
@@ -22,7 +22,7 @@ module Iciba
|
|
22
22
|
"\\1\\3\n")
|
23
23
|
end
|
24
24
|
|
25
|
-
def check_char(str)
|
25
|
+
def self.check_char(str)
|
26
26
|
str.contains_cjk?
|
27
27
|
end
|
28
28
|
|
data/lib/iciba/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iciba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: curb
|