Class: LangExtract::Core::Token

Inherits:
Data
  • Object
show all
Defined in:
lib/langextract/core/tokenizer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#char_intervalObject (readonly)

Returns the value of attribute char_interval

Returns:

  • (Object)

    the current value of char_interval



7
8
9
# File 'lib/langextract/core/tokenizer.rb', line 7

def char_interval
  @char_interval
end

#indexObject (readonly)

Returns the value of attribute index

Returns:

  • (Object)

    the current value of index



7
8
9
# File 'lib/langextract/core/tokenizer.rb', line 7

def index
  @index
end

#textObject (readonly)

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



7
8
9
# File 'lib/langextract/core/tokenizer.rb', line 7

def text
  @text
end

Instance Method Details

#to_hObject



8
9
10
11
12
13
14
# File 'lib/langextract/core/tokenizer.rb', line 8

def to_h
  {
    "text" => text,
    "char_interval" => char_interval.to_h,
    "index" => index
  }
end