Sha256: a9be872ff0c643c811165168c7ffd64e1bb3678efd70a22db8f11b0c686ac011

Contents?: true

Size: 681 Bytes

Versions: 7

Compression:

Stored size: 681 Bytes

Contents

module Opener
  module KAF
    class Term

      attr_reader :document
      attr_reader :node

      def initialize document, node
        @document = document
        @node     = node
      end

      def id
        @id ||= @node.attr :tid
      end

      def lemma
        @node.attr :lemma
      end

      def text
        @node.attr :text
      end

      def pos
        @node.attr :pos
      end

      def setPolarity attrs, polarity_pos
        #In case there is no pos info, we use the polarityPos
        @node[:pos] = polarity_pos if !pos and polarity_pos

        sentiment = @node.add_child('<sentiment/>')
        sentiment.attr attrs
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
opener-polarity-tagger-3.5.3 lib/opener/kaf/term.rb
opener-polarity-tagger-3.5.2 lib/opener/kaf/term.rb
opener-polarity-tagger-3.5.1 lib/opener/kaf/term.rb
opener-polarity-tagger-3.5.0 lib/opener/kaf/term.rb
opener-polarity-tagger-3.4.0 lib/opener/kaf/term.rb
opener-polarity-tagger-3.3.0 lib/opener/kaf/term.rb
opener-polarity-tagger-3.2.7 lib/opener/kaf/term.rb