wiktionary_api 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wiktionary_api/version.rb +1 -1
- data/lib/wiktionary_api/word.rb +4 -4
- data/lib/wiktionary_api.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 319d3ed1a563b1611e76b47de385b213c39e55b3ce4ca9981ffec89994496ed2
|
4
|
+
data.tar.gz: 681e731b9f4592dd43c60be2ccc054314d7ba9e2ac7ad1652ed32e9b94987f24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57789f038f86dfe20c15d35d68df17d54139fb6b30e130d8dbe7ba720274297ff0b16f1d28a5c67c68b9c3a39d6099b1068322d80ff61358485bc357111bc37d
|
7
|
+
data.tar.gz: a599c2f1fdb20f41dff320425e09c891b3d519846fa8a628dfe79903d384143ee69b0a5358292d469c9fe963b1774b4439700f5bcfb258d3fb12396851e5e306
|
data/lib/wiktionary_api/word.rb
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
module WiktionaryAPI
|
2
2
|
class Word
|
3
|
-
attr_reader :part_of_speech, :language
|
3
|
+
attr_reader :part_of_speech, :language, :raw_definitions
|
4
4
|
|
5
5
|
def initialize(data)
|
6
6
|
@part_of_speech = data['partOfSpeech']
|
7
7
|
@language = data['language']
|
8
|
-
@
|
8
|
+
@raw_definitions = data['definitions']
|
9
9
|
end
|
10
10
|
|
11
11
|
def definitions
|
12
|
-
@
|
12
|
+
@raw_definitions.flat_map { |meaning| ::Nokogiri::HTML(meaning['definition']).text.strip }
|
13
13
|
end
|
14
14
|
|
15
15
|
def examples
|
16
|
-
@
|
16
|
+
@raw_definitions.flat_map do |definition|
|
17
17
|
definition["examples"].map do |e|
|
18
18
|
::Nokogiri::HTML(e).text.strip
|
19
19
|
end
|
data/lib/wiktionary_api.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wiktionary_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben D'Angelo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|