abstractor 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +1 -1
- data/app/assets/javascripts/abstractor/abstractor.js +2 -2
- data/app/assets/stylesheets/abstractor/abstractor_abstractions.css +1 -1
- data/app/views/abstractor/abstractor_abstractions/_fields.html.haml +11 -11
- data/app/views/abstractor/abstractor_abstractions/edit.html.haml +8 -7
- data/lib/abstractor/methods/models/abstractor_abstraction_source.rb +2 -1
- data/lib/abstractor/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            !binary "U0hBMQ==":
         | 
| 3 3 | 
             
              metadata.gz: !binary |-
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                MjEzMmZmNTcyYjc4MjZkMjQyZjA5MWE5NzQxYWExMDhhYWExNDcwZQ==
         | 
| 5 5 | 
             
              data.tar.gz: !binary |-
         | 
| 6 | 
            -
                 | 
| 6 | 
            +
                OWNkMzRkZjZiNDU5ZjQ3NDQ5Y2YyMjk0NzhmMGQxNGJmMTA1MGYwNA==
         | 
| 7 7 | 
             
            SHA512:
         | 
| 8 8 | 
             
              metadata.gz: !binary |-
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                 | 
| 11 | 
            -
                 | 
| 9 | 
            +
                ZTJkYjRiZDg4ZjA2NzM2MjYzNjU5NWQzMjA5MmQ3MmFlNzI5YjFhZDhlN2I1
         | 
| 10 | 
            +
                NGE4NzU4MTA2YTEyNDU0YTk2NDcxZjhlYjhiY2U3ZTFjYzliNDg0OWFlYjNj
         | 
| 11 | 
            +
                NzQ3NWU1YTk1NTU4NTc1NTU2ZTZiMDZlZDliOGVmZjg5MDc0N2M=
         | 
| 12 12 | 
             
              data.tar.gz: !binary |-
         | 
| 13 | 
            -
                 | 
| 14 | 
            -
                 | 
| 15 | 
            -
                 | 
| 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'). | 
| 79 | 
            -
                $(this).siblings('.' + source_type + '_' + value). | 
| 78 | 
            +
                $(this).siblings('.indirect_source_text').addClass('hidden');
         | 
| 79 | 
            +
                $(this).siblings('.' + source_type + '_' + value).removeClass('hidden');
         | 
| 80 80 | 
             
              });
         | 
| 81 81 | 
             
            };
         | 
| 82 82 |  | 
| @@ -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  | 
| 40 | 
            -
                                  %span{ :class => 'abstractor_abstraction_source_tooltip_img label', :rel => "#abstraction_text_#{abstractor_suggestion_source.id}", :title => "#{ | 
| 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 =  | 
| 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 | 
            -
                      -  | 
| 62 | 
            -
             | 
| 63 | 
            -
                        %span{ :class => 'abstractor_abstraction_source_tooltip_img label', :rel => | 
| 64 | 
            -
                          = image_tag('abstractor/page.png', :id => "abstraction_text_link_#{ | 
| 65 | 
            -
             | 
| 66 | 
            -
             | 
| 67 | 
            -
                           | 
| 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 | 
            -
                    -  | 
| 49 | 
            -
             | 
| 50 | 
            -
                       | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 53 | 
            -
                       | 
| 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 =  | 
| 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
         | 
    
        data/lib/abstractor/version.rb
    CHANGED
    
    
    
        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. | 
| 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- | 
| 11 | 
            +
            date: 2014-07-31 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         |