Class: TextRazor::Word

Inherits:
Object
  • Object
show all
Defined in:
lib/text_razor/word.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Word

Returns a new instance of Word.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/text_razor/word.rb', line 6

def initialize(options={})
  @parent_position    = options['parentPosition']
  @relation_to_parent = options['relationToParent']
  @position           = options['position']
  @stem               = options['stem']
  @lemma              = options['lemma']
  @token              = options['token']
  @part_of_speech     = options['partOfSpeech']
  @starting_pos       = options['starting_pos']
  @ending_pos         = options['ending_pos']
end

Instance Attribute Details

#ending_posObject (readonly)

Returns the value of attribute ending_pos.



3
4
5
# File 'lib/text_razor/word.rb', line 3

def ending_pos
  @ending_pos
end

#lemmaObject (readonly)

Returns the value of attribute lemma.



3
4
5
# File 'lib/text_razor/word.rb', line 3

def lemma
  @lemma
end

#parent_positionObject (readonly)

Returns the value of attribute parent_position.



3
4
5
# File 'lib/text_razor/word.rb', line 3

def parent_position
  @parent_position
end

#part_of_speechObject (readonly)

Returns the value of attribute part_of_speech.



3
4
5
# File 'lib/text_razor/word.rb', line 3

def part_of_speech
  @part_of_speech
end

#positionObject (readonly)

Returns the value of attribute position.



3
4
5
# File 'lib/text_razor/word.rb', line 3

def position
  @position
end

#relation_to_parentObject (readonly)

Returns the value of attribute relation_to_parent.



3
4
5
# File 'lib/text_razor/word.rb', line 3

def relation_to_parent
  @relation_to_parent
end

#starting_posObject (readonly)

Returns the value of attribute starting_pos.



3
4
5
# File 'lib/text_razor/word.rb', line 3

def starting_pos
  @starting_pos
end

#stemObject (readonly)

Returns the value of attribute stem.



3
4
5
# File 'lib/text_razor/word.rb', line 3

def stem
  @stem
end

#tokenObject (readonly)

Returns the value of attribute token.



3
4
5
# File 'lib/text_razor/word.rb', line 3

def token
  @token
end