Class: Varar::Core::Sentence
- Inherits:
-
Data
- Object
- Data
- Varar::Core::Sentence
- Defined in:
- lib/varar/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
9 10 11 |
# File 'lib/varar/core/sentences.rb', line 9 def end_offset @end_offset end |
#start_offset ⇒ Object (readonly)
Returns the value of attribute start_offset
9 10 11 |
# File 'lib/varar/core/sentences.rb', line 9 def start_offset @start_offset end |
#text ⇒ Object (readonly)
Returns the value of attribute text
9 10 11 |
# File 'lib/varar/core/sentences.rb', line 9 def text @text end |