Class: PragmaticSegmenter::PunctuationReplacer
- Inherits:
-
Object
- Object
- PragmaticSegmenter::PunctuationReplacer
- Defined in:
- lib/pragmatic_segmenter/punctuation_replacer.rb
Overview
This class replaces punctuation that is typically a sentence boundary but in this case is not a sentence boundary.
Defined Under Namespace
Modules: Rules
Instance Attribute Summary collapse
-
#match_type ⇒ Object
readonly
Returns the value of attribute match_type.
-
#matches_array ⇒ Object
readonly
Returns the value of attribute matches_array.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text:, matches_array:, match_type: nil) ⇒ PunctuationReplacer
constructor
A new instance of PunctuationReplacer.
- #replace ⇒ Object
Constructor Details
#initialize(text:, matches_array:, match_type: nil) ⇒ PunctuationReplacer
Returns a new instance of PunctuationReplacer.
34 35 36 37 38 |
# File 'lib/pragmatic_segmenter/punctuation_replacer.rb', line 34 def initialize(text:, matches_array:, match_type: nil) @text = text @matches_array = matches_array @match_type = match_type end |
Instance Attribute Details
#match_type ⇒ Object (readonly)
Returns the value of attribute match_type.
33 34 35 |
# File 'lib/pragmatic_segmenter/punctuation_replacer.rb', line 33 def match_type @match_type end |
#matches_array ⇒ Object (readonly)
Returns the value of attribute matches_array.
33 34 35 |
# File 'lib/pragmatic_segmenter/punctuation_replacer.rb', line 33 def matches_array @matches_array end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
33 34 35 |
# File 'lib/pragmatic_segmenter/punctuation_replacer.rb', line 33 def text @text end |
Instance Method Details
#replace ⇒ Object
40 41 42 |
# File 'lib/pragmatic_segmenter/punctuation_replacer.rb', line 40 def replace replace_punctuation(matches_array) end |