Class: StanfordParser::StandoffToken

Inherits:
Struct
  • Object
show all
Defined in:
lib/stanfordparser.rb

Overview

A text token that contains raw and normalized token identity (.e.g “(” and “-LRB-”), an offset span, and the characters immediately preceding and following the token. Given a list of these objects it is possible to recreate the text from which they came verbatim.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#afterObject

Returns the value of attribute after

Returns:

  • (Object)

    the current value of after



244
245
246
# File 'lib/stanfordparser.rb', line 244

def after
  @after
end

#beforeObject

Returns the value of attribute before

Returns:

  • (Object)

    the current value of before



244
245
246
# File 'lib/stanfordparser.rb', line 244

def before
  @before
end

#begin_positionObject

Returns the value of attribute begin_position

Returns:

  • (Object)

    the current value of begin_position



244
245
246
# File 'lib/stanfordparser.rb', line 244

def begin_position
  @begin_position
end

#currentObject

Returns the value of attribute current

Returns:

  • (Object)

    the current value of current



244
245
246
# File 'lib/stanfordparser.rb', line 244

def current
  @current
end

#end_positionObject

Returns the value of attribute end_position

Returns:

  • (Object)

    the current value of end_position



244
245
246
# File 'lib/stanfordparser.rb', line 244

def end_position
  @end_position
end

#wordObject

Returns the value of attribute word

Returns:

  • (Object)

    the current value of word



244
245
246
# File 'lib/stanfordparser.rb', line 244

def word
  @word
end

Instance Method Details

#to_sObject



246
247
248
# File 'lib/stanfordparser.rb', line 246

def to_s
  "#{current} [#{begin_position},#{end_position}]"
end