Sha256: 20220115eb02d9fc4ed05f7cba2cfe8e7378d0c12df39f14db70af1cb731ee87

Contents?: true

Size: 630 Bytes

Versions: 49

Compression:

Stored size: 630 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 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

49 entries across 49 versions & 2 rubygems

Version Path
opener-polarity-tagger-3.2.5 lib/opener/polarity_tagger/kaf/term.rb
opener-polarity-tagger-3.2.4 lib/opener/polarity_tagger/kaf/term.rb
opener-polarity-tagger-3.2.3 lib/opener/polarity_tagger/kaf/term.rb
opener-polarity-tagger-3.2.2 lib/opener/polarity_tagger/kaf/term.rb
opener-polarity-tagger-3.2.1 lib/opener/polarity_tagger/kaf/term.rb
opener-polarity-tagger-3.1.3 lib/opener/polarity_tagger/kaf/term.rb
opener-polarity-tagger-3.1.2 lib/opener/polarity_tagger/kaf/term.rb
opener-polarity-tagger-3.1.1 lib/opener/polarity_tagger/kaf/term.rb
opener-polarity-tagger-3.1.0 lib/opener/polarity_tagger/kaf/term.rb