Class: Desmoservice::TaggedTerm

Inherits:
Term
  • Object
show all
Defined in:
lib/word_distribution.rb

Instance Attribute Summary collapse

Attributes inherited from Term

#attrs, #color, #id, #localkey, #parent_id, #parent_localkey, #text

Instance Method Summary collapse

Methods inherited from Term

#[], #color?, #has_attr?, #localkey?, #text?

Constructor Details

#initialize(data) ⇒ TaggedTerm

Returns a new instance of TaggedTerm.



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/word_distribution.rb', line 47

def initialize(data)
  super(data['descripteur'])
  @tagged_parts = Array.new
  data['text'].each do |v|
    if v.respond_to?('has_key?')
      @tagged_parts << TaggedPart.new(v['lexie'], v['value'])
    else
      @tagged_parts << TaggedPart.new(nil, v)
    end
  end
end

Instance Attribute Details

#tagged_partsObject (readonly)

Returns the value of attribute tagged_parts.



45
46
47
# File 'lib/word_distribution.rb', line 45

def tagged_parts
  @tagged_parts
end