biblicit 2.0.8 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,7 +30,8 @@ module CiteSeer
30
30
  def parse(xml)
31
31
  {
32
32
  title: xml.css('title').text,
33
- authors: xml.css('author > name').map { |n| n.text },
33
+ authors: xml.css('author > name').map { |n| n.text.strip }.reject(&:blank?).uniq,
34
+ author_emails: xml.css('author > email').map { |n| n.text.strip }.reject(&:blank?).uniq,
34
35
  abstract: xml.css('abstract').text,
35
36
  valid: xml.css('validHeader').first.text == '1',
36
37
  }
@@ -26,11 +26,29 @@ module ParsCit
26
26
 
27
27
  def parse(xml)
28
28
  parsed = xml.css("algorithm[name=ParsHed]")
29
- {
29
+
30
+ result = {
30
31
  title: parsed.css('title').text.gsub(/\s+/,' ').strip,
31
32
  authors: parsed.css('author').map { |a| a.text.gsub(/\s+/,' ').strip },
32
33
  abstract: parsed.css('abstract').text
33
34
  }
35
+
36
+ citations = xml.css('algorithm[name=ParsCit] > citationList > citation').map do |node|
37
+ cite = {
38
+ authors: node.css('author').map(&:text).map(&:strip).reject(&:blank?).uniq
39
+ }
40
+
41
+ node.children.each do |child|
42
+ unless ['contexts','authors','marker','rawString'].include?(child.name) || (text = child.text.strip).blank?
43
+ cite[child.name.to_sym] = text
44
+ end
45
+ end
46
+
47
+ cite
48
+ end
49
+
50
+ result[:citations] = citations
51
+ result
34
52
  end
35
53
 
36
54
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Biblicit
4
4
 
5
- VERSION = '2.0.8'
5
+ VERSION = '2.1.0'
6
6
 
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biblicit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: