INNER CODE UNIT · Ruby
replace_period_of_abbr
grobidOrg/grobid · grobid-home/sentence-segmentation/pragmatic_segmenter/abbreviation_replacer.rb:111
def replace_period_of_abbr(txt, abbr)
txt.gsub!(/(?<=\s#{abbr.strip})\.(?=((\.|\:|-|\?)|(\s([a-z]|I\s|I'm|I'll|\d|\())))|(?<=^#{abbr.strip})\.(?=((\.|\:|\?)|(\s([a-z]|I\s|I'm|I'll|\d))))/, '∯')
txt.gsub!(/(?<=\s#{abbr.strip})\.(?=,)|(?<=^#{abbr.strip})\.(?=,)/, '∯')
txt
end
def replace_possessive_abbreviations(txt)
txt.gsub!(@language::POSSESSIVE_ABBREVIATION_REGEX, '∯')
txt
end
end
end