INNER CODE UNIT · Ruby
upper
grobidOrg/grobid · grobid-home/sentence-segmentation/pragmatic_segmenter/abbreviation_replacer.rb:52
upper = /[[:upper:]]/.match(character.to_s)
if upper.nil? || prepositive.include?(Unicode::downcase(am.strip))
if prepositive.include?(Unicode::downcase(am.strip))
txt = replace_prepositive_abbr(txt, am)
elsif number_abbr.include?(Unicode::downcase(am.strip))
txt = replace_pre_number_abbr(txt, am)
else
txt = replace_period_of_abbr(txt, am)
end
end
txt
end
def replace_abbreviation_as_sentence_boundary(txt)
# As we are being conservative and keeping ambiguous
# sentence boundaries as one sentence instead of
# splitting into two, we can split at words that
# we know for certain never follow these abbreviations.