abstractor 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmI1ZTY3ZWJlZTU1MjhhNWU1MDYxZWNkNWQxMWE5YTUzOTlmYjM3NA==
4
+ MjEzMmZmNTcyYjc4MjZkMjQyZjA5MWE5NzQxYWExMDhhYWExNDcwZQ==
5
5
  data.tar.gz: !binary |-
6
- M2YyMGQwOWFmMTRiYzdkZTRlY2IzOWFhNzAwYzIzYmU1MjUzMzdhMw==
6
+ OWNkMzRkZjZiNDU5ZjQ3NDQ5Y2YyMjk0NzhmMGQxNGJmMTA1MGYwNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTAxZDAyMzE0OTQ2YzYxYWE0OWY4ZmUyYzhmYzlkOWJjN2M1ZWE4YzcxZmE4
10
- MDdiZTNjZDA1ZDljYTc3ZjJkZDZjNDY2ZDAwZTMxMGFiMzdjN2Y0NGRlYzk0
11
- YTkwOTdmMjY5N2M3NjQ3ZDkxODYxZDRhOTI0ODE0ODRlYzQxMzY=
9
+ ZTJkYjRiZDg4ZjA2NzM2MjYzNjU5NWQzMjA5MmQ3MmFlNzI5YjFhZDhlN2I1
10
+ NGE4NzU4MTA2YTEyNDU0YTk2NDcxZjhlYjhiY2U3ZTFjYzliNDg0OWFlYjNj
11
+ NzQ3NWU1YTk1NTU4NTc1NTU2ZTZiMDZlZDliOGVmZjg5MDc0N2M=
12
12
  data.tar.gz: !binary |-
13
- YWM2YmE0MDI2ZmEzZjljMmU0OWVlMmE1MmQ5YTgzNzg3ZDk0Mzc0OTFlMWNk
14
- YTA1M2JlMWZiY2QyZDU1ZGEwYjYxZWJiMzQ1NTg4ZmRhMTY2YWY0Mjc2Yzk4
15
- YTU3YzdhNWUzMTk5NzgyMTY4ZmMzMDJlNzI3ZmRlZjM4MTE4Mzg=
13
+ N2FiMTI4YmEwYTlkZTE2NGFmMzU1NDUyODE3NGNjODdiNjA2YjU1NTYyY2Yz
14
+ MmNkN2ZlODY5MzY1ZTA4ODQ3NzQ1MDM1M2QyNDlhYTE1MmQ0NDUyOGM0M2Ni
15
+ NjlkN2EyNDA1OWE2YTUzNTMxMTkwMDAxMzU1MGFjY2UyMGY0ZjY=
data/README.md CHANGED
@@ -3,7 +3,7 @@ Abstractor
3
3
  Abstractor is a Rails engine gem for deriving discrete data points
4
4
  from narrative text via natural language processing. The gem includes
5
5
  a user interface to present the abstracted data points for
6
- confirmation/revision by curator.
6
+ confirmation/revision by a curator.
7
7
 
8
8
  Reader's note: this README uses [YARD][] markup to provide links to
9
9
  Abstractor's API documentation. If you aren't already, consider reading it
@@ -75,8 +75,8 @@ Abstractor.AbstractionUI = function(){
75
75
  $(document).on('change', 'select.indirect_source_list', function () {
76
76
  var source_type = $(this).attr('rel'),
77
77
  value = $(this).find('option:selected').prop('value');
78
- $(this).siblings('.indirect_source_text').hide();
79
- $(this).siblings('.' + source_type + '_' + value).show();
78
+ $(this).siblings('.indirect_source_text').addClass('hidden');
79
+ $(this).siblings('.' + source_type + '_' + value).removeClass('hidden');
80
80
  });
81
81
  };
82
82
 
@@ -321,7 +321,7 @@ span.tooltip_img {
321
321
  }
322
322
 
323
323
  .indirect_source_list {
324
- width: 20em;
324
+ width: 35%;
325
325
  }
326
326
 
327
327
  .indirect_source_text {
@@ -35,12 +35,13 @@
35
35
  = abstractor_suggestion.display_value
36
36
  - if abstractor_suggestion.abstractor_suggestion_sources.any?
37
37
  - abstractor_suggestion.abstractor_suggestion_sources.each do |abstractor_suggestion_source|
38
+ - source_about = abstractor_suggestion_source.source_type.constantize.find(abstractor_suggestion_source.source_id)
38
39
  - from_method = abstractor_suggestion_source.source_method
39
- - if about.respond_to?(from_method)
40
- %span{ :class => 'abstractor_abstraction_source_tooltip_img label', :rel => "#abstraction_text_#{abstractor_suggestion_source.id}", :title => "#{about.class.to_s} #{from_method}"}
40
+ - if from_method && source_about.respond_to?(from_method)
41
+ %span{ :class => 'abstractor_abstraction_source_tooltip_img label', :rel => "#abstraction_text_#{abstractor_suggestion_source.id}", :title => "#{source_about.class.to_s} #{from_method}"}
41
42
  = image_tag('abstractor/page.png', :id => "abstraction_text_link_#{abstractor_suggestion_source.id}")
42
43
  %div{ :id => "abstraction_text_#{abstractor_suggestion_source.id}", :class => 'abstractor_abstraction_source_tooltip'}
43
- - abstractable_from_column = about.send(from_method)
44
+ - abstractable_from_column = source_about.send(from_method)
44
45
  - unless abstractable_from_column.nil?
45
46
  - if abstractor_suggestion_source.sentence_match_value
46
47
  = Abstractor::UserInterface.highlight(simple_format(abstractable_from_column.clone), abstractor_suggestion_source.sentence_match_value.strip)
@@ -58,12 +59,11 @@
58
59
  - else
59
60
  .column-9
60
61
  - abstractor_abstraction.abstractor_subject.abstractor_abstraction_sources.select { |s| s.abstractor_abstraction_source_type.name == 'nlp suggestion' }.each do |abstractor_abstraction_source|
61
- - from_method = abstractor_abstraction_source.from_method
62
- - if about.respond_to?(from_method)
63
- %span{ :class => 'abstractor_abstraction_source_tooltip_img label', :rel => "#abstraction_text_#{abstractor_abstraction_source.id}", :title => "#{about.class.to_s} #{from_method}"}
64
- = image_tag('abstractor/page.png', :id => "abstraction_text_link_#{abstractor_abstraction_source.id}")
65
- %div{ :id => "abstraction_text_#{abstractor_abstraction_source.id}", :class => 'abstractor_abstraction_source_tooltip'}
66
- - abstractable_from_column = about.send(from_method)
67
- - unless abstractable_from_column.nil?
68
- = abstractable_from_column.clone
62
+ - abstractor_abstraction_source.normalize_from_method_to_sources(abstractor_abstraction.about).each do |source|
63
+ - dom_id = "#{abstractor_abstraction_source.id}_#{source[:source_type]}_#{source[:source_id]}_#{source[:source_method]}"
64
+ %span{ :class => 'abstractor_abstraction_source_tooltip_img label', :rel =>"#abstraction_text_#{dom_id}", :title => "#{source[:source_type].to_s} #{source[:source_method]}"}
65
+ = image_tag('abstractor/page.png', :id => "abstraction_text_link_#{dom_id}")
66
+ %br
67
+ %div{ :id => "abstraction_text_#{dom_id}", :class => 'tooltip'}
68
+ = simple_format(source[:source_type].find(source[:source_id]).send(source[:source_method]))
69
69
  .clear
@@ -45,12 +45,13 @@
45
45
  - abstractor_abstraction = f.object
46
46
  - abstraction_sources = abstractor_abstraction.abstractor_subject.abstractor_abstraction_sources.select { |s| s.abstractor_abstraction_source_type.name == 'nlp suggestion' }
47
47
  - abstraction_sources.each do |abstraction_source|
48
- - from_method = abstraction_source.from_method
49
- %span{ :class => 'abstractor_abstraction_source_tooltip_img label', :rel => "#abstraction_text_#{abstraction_source.id}", :title => "#{abstractor_abstraction.about.class.to_s} #{from_method}"}
50
- = image_tag('abstractor/page.png', :id => "abstraction_text_link_#{abstraction_source.id}")
51
- %br
52
- %div{ :id => "abstraction_text_#{abstraction_source.id}", :class => 'tooltip'}
53
- = simple_format(abstractor_abstraction.about.send(from_method))
48
+ - abstraction_source.normalize_from_method_to_sources(abstractor_abstraction.about).each do |source|
49
+ - dom_id = "#{abstraction_source.id}_#{source[:source_type]}_#{source[:source_id]}_#{source[:source_method]}"
50
+ %span{ :class => 'abstractor_abstraction_source_tooltip_img label', :rel =>"#abstraction_text_#{dom_id}", :title => "#{source[:source_type].to_s} #{source[:source_method]}"}
51
+ = image_tag('abstractor/page.png', :id => "abstraction_text_link_#{dom_id}")
52
+ %br
53
+ %div{ :id => "abstraction_text_#{dom_id}", :class => 'tooltip'}
54
+ = simple_format(source[:source_type].find(source[:source_id]).send(source[:source_method]))
54
55
  .column-4
55
56
  = f.submit 'Save', :class => 'button positive'
56
57
  = link_to 'Cancel', abstractor_abstraction, :class => 'button negative', :remote => true
@@ -70,4 +71,4 @@
70
71
  - sources.each do |source|
71
72
  - hidden = abstractor_indirect_source_form.object.source_id == source.id ? '' : 'hidden'
72
73
  %div{ class: "indirect_source_text #{hidden} #{source_setup[:source_type]}_#{source.id}"}
73
- = source.send(source_setup[:source_method])
74
+ = simple_format(source.send(source_setup[:source_method]))
@@ -18,7 +18,8 @@ module Abstractor
18
18
 
19
19
  def normalize_from_method_to_sources(about)
20
20
  sources = []
21
- fm = about.send(from_method)
21
+ fm = nil
22
+ fm = about.send(from_method) unless from_method.blank?
22
23
  if fm.is_a?(String) || fm.nil?
23
24
  sources = [{ source_type: about.class , source_id: about.id , source_method: from_method }]
24
25
  else
@@ -1,3 +1,3 @@
1
1
  module Abstractor
2
- VERSION = '2.0.0'
2
+ VERSION = '2.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abstractor
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Gurley, Yulia Bushmanova
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-30 00:00:00.000000000 Z
11
+ date: 2014-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails