Class: Oselvar::Var::Core::Sentence
- Inherits:
-
Data
- Object
- Data
- Oselvar::Var::Core::Sentence
- 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
-
#end_offset ⇒ Object
readonly
Returns the value of attribute end_offset.
-
#start_offset ⇒ Object
readonly
Returns the value of attribute start_offset.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Attribute Details
#end_offset ⇒ Object (readonly)
Returns the value of attribute end_offset
10 11 12 |
# File 'lib/oselvar/var/core/sentences.rb', line 10 def end_offset @end_offset end |
#start_offset ⇒ Object (readonly)
Returns the value of attribute start_offset
10 11 12 |
# File 'lib/oselvar/var/core/sentences.rb', line 10 def start_offset @start_offset end |
#text ⇒ Object (readonly)
Returns the value of attribute text
10 11 12 |
# File 'lib/oselvar/var/core/sentences.rb', line 10 def text @text end |