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-chained-daemon-3.3.28 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.27 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.26 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.25 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.24 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.23 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.22 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.21 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.20 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.19 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.18 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.17 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.16 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.15 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.14 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.13 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.12 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.11 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.10 lib/opener/kaf/term.rb
opener-chained-daemon-3.3.9 lib/opener/kaf/term.rb