Class: FreelingClient::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/freeling_client/token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opt = {}) ⇒ Token

Returns a new instance of Token.



6
7
8
9
10
11
# File 'lib/freeling_client/token.rb', line 6

def initialize(opt = {})
  @form = opt[:form]
  @lemma = opt[:lemma]
  @tag = opt[:tag]
  @prob = opt[:tag]
end

Instance Attribute Details

#formObject

Returns the value of attribute form.



4
5
6
# File 'lib/freeling_client/token.rb', line 4

def form
  @form
end

#lemmaObject

Returns the value of attribute lemma.



4
5
6
# File 'lib/freeling_client/token.rb', line 4

def lemma
  @lemma
end

#posObject

Returns the value of attribute pos.



4
5
6
# File 'lib/freeling_client/token.rb', line 4

def pos
  @pos
end

#probObject

Returns the value of attribute prob.



4
5
6
# File 'lib/freeling_client/token.rb', line 4

def prob
  @prob
end

#tagObject

Returns the value of attribute tag.



4
5
6
# File 'lib/freeling_client/token.rb', line 4

def tag
  @tag
end

Instance Method Details

#[](key) ⇒ Object



13
14
15
16
# File 'lib/freeling_client/token.rb', line 13

def [](key)
  key = key.to_sym if key.is_a? String
  self.send(key)
end