dictuby 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dictuby/sources/slovnik_azet_sk.rb +4 -1
- data/lib/dictuby/sources/slovnik_cz.rb +6 -4
- 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: 3138302a2704df1949dad563f69d8f665a9e9e89
|
4
|
+
data.tar.gz: 2fea28a250e63a449f411b4f9c6c17603b710cec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b0fdcf8f44e2e6f9cf7e3b810ce9ef3eb2a879f3cc51d18ab3afbc7b244c0f357f947cf7b9698cd1782840f658482ccf4ada6750df721761b6ef39f20127db4
|
7
|
+
data.tar.gz: fa46e9a16aefc15e2efba45825e5dbea9806b4ae5efef1d92805b8aa788bd2deb07eecdfd7c2c8aaf36a12ee9674723cb9654b30817cc38562846ed838c9296a
|
@@ -18,11 +18,14 @@ module Dictuby
|
|
18
18
|
'ru-sk' => 'rusko-slovensky',
|
19
19
|
'sk-ru' => 'slovensko-rusky',
|
20
20
|
}
|
21
|
-
@url =
|
21
|
+
@url = 'http://slovnik.azet.sk/preklad/%{dict}/?q=%{query}'
|
22
22
|
|
23
23
|
def self.process(page, query)
|
24
|
+
query = I18n.transliterate(query)
|
24
25
|
left = page.xpath('//table[1]//span')[0].text rescue nil
|
26
|
+
left = I18n.transliterate(left)
|
25
27
|
return [] unless left == query
|
28
|
+
|
26
29
|
right = page.xpath(
|
27
30
|
'//table[1]//tr/td[@class="do"]/span'
|
28
31
|
).inject([]) {
|
@@ -14,15 +14,17 @@ module Dictuby
|
|
14
14
|
'sp-cz' => 'spcz.sp',
|
15
15
|
'cz-sp' => 'spcz.cz',
|
16
16
|
}
|
17
|
-
@url =
|
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 = I18n.transliterate(query)
|
20
21
|
pairs = page.xpath('//div[@class="pair"]')
|
21
22
|
|
22
|
-
pairs.inject([]) do |
|
23
|
+
pairs.inject([]) do |right, pair|
|
23
24
|
left = pair.xpath('span[@class="l"]')[0].text
|
24
|
-
|
25
|
-
|
25
|
+
left = I18n.transliterate(left)
|
26
|
+
return right if left != query
|
27
|
+
right << pair.xpath('span[@class="r"]')[0].text
|
26
28
|
end
|
27
29
|
end
|
28
30
|
end
|
data/lib/dictuby.rb
CHANGED