infoboxer 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/bin/infoboxer +11 -12
- data/infoboxer.gemspec +3 -2
- data/lib/infoboxer/core_ext.rb +1 -0
- data/lib/infoboxer/definitions/en.wikipedia.org.rb +13 -13
- data/lib/infoboxer/media_wiki/page.rb +4 -3
- data/lib/infoboxer/media_wiki/traits.rb +12 -10
- data/lib/infoboxer/media_wiki.rb +97 -68
- data/lib/infoboxer/navigation/lookup.rb +30 -26
- data/lib/infoboxer/navigation/sections.rb +33 -37
- data/lib/infoboxer/navigation/selector.rb +5 -6
- data/lib/infoboxer/navigation/shortcuts.rb +12 -11
- data/lib/infoboxer/navigation.rb +2 -1
- data/lib/infoboxer/parser/context.rb +12 -13
- data/lib/infoboxer/parser/html.rb +7 -6
- data/lib/infoboxer/parser/image.rb +25 -29
- data/lib/infoboxer/parser/inline.rb +82 -79
- data/lib/infoboxer/parser/paragraphs.rb +34 -37
- data/lib/infoboxer/parser/table.rb +26 -27
- data/lib/infoboxer/parser/template.rb +12 -4
- data/lib/infoboxer/parser/util.rb +11 -16
- data/lib/infoboxer/parser.rb +8 -1
- data/lib/infoboxer/templates/base.rb +3 -3
- data/lib/infoboxer/templates/set.rb +11 -10
- data/lib/infoboxer/tree/compound.rb +7 -6
- data/lib/infoboxer/tree/document.rb +1 -0
- data/lib/infoboxer/tree/html.rb +5 -4
- data/lib/infoboxer/tree/image.rb +8 -7
- data/lib/infoboxer/tree/inline.rb +4 -5
- data/lib/infoboxer/tree/linkable.rb +3 -5
- data/lib/infoboxer/tree/list.rb +15 -16
- data/lib/infoboxer/tree/node.rb +11 -10
- data/lib/infoboxer/tree/nodes.rb +24 -23
- data/lib/infoboxer/tree/paragraphs.rb +3 -2
- data/lib/infoboxer/tree/ref.rb +6 -3
- data/lib/infoboxer/tree/table.rb +13 -13
- data/lib/infoboxer/tree/template.rb +15 -15
- data/lib/infoboxer/tree/text.rb +2 -1
- data/lib/infoboxer/tree/wikilink.rb +9 -8
- data/lib/infoboxer/tree.rb +3 -2
- data/lib/infoboxer/version.rb +2 -1
- data/lib/infoboxer.rb +24 -26
- data/regression/pages/wyoming.wiki +1085 -0
- metadata +8 -21
- data/lib/infoboxer/media_wiki/mediawiktory_patch.rb +0 -23
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infoboxer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Shepelev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.0
|
47
|
+
version: 0.1.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.0
|
54
|
+
version: 0.1.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: addressable
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: backports
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
83
|
description: |2
|
98
84
|
Infoboxer is library targeting use of Wikipedia (or any other
|
99
85
|
MediaWiki-based wiki) as a rich powerful data source.
|
@@ -105,6 +91,7 @@ extra_rdoc_files: []
|
|
105
91
|
files:
|
106
92
|
- ".codeclimate.yml"
|
107
93
|
- ".dokaz"
|
94
|
+
- ".rubocop_todo.yml"
|
108
95
|
- ".yardopts"
|
109
96
|
- CHANGELOG.md
|
110
97
|
- CONTRIBUTING.md
|
@@ -121,7 +108,6 @@ files:
|
|
121
108
|
- lib/infoboxer/core_ext.rb
|
122
109
|
- lib/infoboxer/definitions/en.wikipedia.org.rb
|
123
110
|
- lib/infoboxer/media_wiki.rb
|
124
|
-
- lib/infoboxer/media_wiki/mediawiktory_patch.rb
|
125
111
|
- lib/infoboxer/media_wiki/page.rb
|
126
112
|
- lib/infoboxer/media_wiki/traits.rb
|
127
113
|
- lib/infoboxer/navigation.rb
|
@@ -175,6 +161,7 @@ files:
|
|
175
161
|
- regression/pages/ukraine.wiki
|
176
162
|
- regression/pages/ukrainian_galician_army.wiki
|
177
163
|
- regression/pages/usa.wiki
|
164
|
+
- regression/pages/wyoming.wiki
|
178
165
|
homepage: https://github.com/molybdenum-99/infoboxer
|
179
166
|
licenses:
|
180
167
|
- MIT
|
@@ -187,7 +174,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
187
174
|
requirements:
|
188
175
|
- - ">="
|
189
176
|
- !ruby/object:Gem::Version
|
190
|
-
version:
|
177
|
+
version: 2.1.0
|
191
178
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
179
|
requirements:
|
193
180
|
- - ">="
|
@@ -195,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
182
|
version: '0'
|
196
183
|
requirements: []
|
197
184
|
rubyforge_project:
|
198
|
-
rubygems_version: 2.
|
185
|
+
rubygems_version: 2.6.10
|
199
186
|
signing_key:
|
200
187
|
specification_version: 4
|
201
188
|
summary: MediaWiki client and parser, targeting information extraction.
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'mediawiktory'
|
2
|
-
|
3
|
-
# FIXME: looks like pretty "core" functionality and should moved to mediawiktory itself
|
4
|
-
|
5
|
-
class MediaWiktory::Page
|
6
|
-
def alt_titles
|
7
|
-
@alt_titles ||= [title]
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
class MediaWiktory::Query::Response
|
12
|
-
alias_method :old_initialize, :initialize
|
13
|
-
def initialize(*arg)
|
14
|
-
old_initialize(*arg)
|
15
|
-
|
16
|
-
if raw.query.redirects
|
17
|
-
raw.query.redirects.each do |redirect|
|
18
|
-
pg = @pages.detect{|p| p.title == redirect.to} or next
|
19
|
-
pg.alt_titles << redirect.from
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|