Class: Oselvar::Var::Core::Sentence

Inherits:
Data
  • Object
show all
Defined in:
lib/oselvar/var/core/sentences.rb

Overview

Split a block of plain text into sentences on . ! ? and \n, skipping terminators inside backtick spans and double-quoted strings and treating common abbreviations as non-breaking. All offsets are UTF-16 code units into the block text. Port of sentences.ts.

Instance Attribute Summary collapse

Instance Attribute Details

#end_offsetObject (readonly)

Returns the value of attribute end_offset

Returns:

  • (Object)

    the current value of end_offset



10
11
12
# File 'lib/oselvar/var/core/sentences.rb', line 10

def end_offset
  @end_offset
end

#start_offsetObject (readonly)

Returns the value of attribute start_offset

Returns:

  • (Object)

    the current value of start_offset



10
11
12
# File 'lib/oselvar/var/core/sentences.rb', line 10

def start_offset
  @start_offset
end

#textObject (readonly)

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



10
11
12
# File 'lib/oselvar/var/core/sentences.rb', line 10

def text
  @text
end