dictuby 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dictuby/runner.rb +7 -3
- data/lib/dictuby/sources/slovnik_azet_sk.rb +2 -2
- data/lib/dictuby/sources/slovnik_cz.rb +2 -3
- data/lib/dictuby.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe4107b51d0b403e947b655cc5c8b03e5e44812f
|
4
|
+
data.tar.gz: a6c824d9da680812fd881d67abf2f2fc98ecf174
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e582f865d2a5de6a8b381147cd8e86da7193fd5bba0cfcdad53dd1113084d3a015e036324a59d093d386955c12491401e92837c53fb31f62e08934ec2c021ea
|
7
|
+
data.tar.gz: 2056910517c82a021dff2770f2aa3d2d245efa462c43772b8aa2bdf0a810c791d53241e168a0e257e3829d82b838b7c397ce1e897bce330e46abbe35874036b8
|
data/lib/dictuby/runner.rb
CHANGED
@@ -38,9 +38,13 @@ module Dictuby
|
|
38
38
|
p.dicts.keys.each {|d| r[d] = p}; r
|
39
39
|
end
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
if map.include?(dict)
|
42
|
+
puts query
|
43
|
+
map[dict].lookup(dict, query).each do |word|
|
44
|
+
puts "- #{word}"
|
45
|
+
end
|
46
|
+
else
|
47
|
+
puts 'Invalid dictionary'
|
44
48
|
end
|
45
49
|
end
|
46
50
|
end
|
@@ -21,9 +21,9 @@ module Dictuby
|
|
21
21
|
@url = 'http://slovnik.azet.sk/preklad/%{dict}/?q=%{query}'
|
22
22
|
|
23
23
|
def self.process(page, query)
|
24
|
-
query =
|
24
|
+
query = query.normalize
|
25
25
|
left = page.xpath('//table[1]//span')[0].text rescue nil
|
26
|
-
left
|
26
|
+
left.normalize!
|
27
27
|
return [] unless left == query
|
28
28
|
|
29
29
|
right = page.xpath(
|
@@ -17,12 +17,11 @@ module Dictuby
|
|
17
17
|
@url = 'http://slovnik.cz/bin/mld.fpl?vcb=%{query}&dictdir=%{dict}&lines=30&js=0'
|
18
18
|
|
19
19
|
def self.process(page, query)
|
20
|
-
query =
|
20
|
+
query = query.normalize
|
21
21
|
pairs = page.xpath('//div[@class="pair"]')
|
22
22
|
|
23
23
|
pairs.inject([]) do |right, pair|
|
24
|
-
left = pair.xpath('span[@class="l"]')[0].text
|
25
|
-
left = I18n.transliterate(left)
|
24
|
+
left = pair.xpath('span[@class="l"]')[0].text.normalize
|
26
25
|
return right if left != query
|
27
26
|
right << pair.xpath('span[@class="r"]')[0].text
|
28
27
|
end
|
data/lib/dictuby.rb
CHANGED