INNER CODE UNIT · Ruby
replace_abbreviation_as_sentence_boundary
grobidOrg/grobid · grobid-home/sentence-segmentation/pragmatic_segmenter/abbreviation_replacer.rb:65
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.
# Some might say that the set of words that follow an
# abbreviation such as U.S. (i.e. U.S. Government) is smaller than
# the set of words that could start a sentence and
# never follow U.S. However, we are being conservative
# and not splitting by default, so we need to look for places
# where we definitely can split. Obviously SENTENCE_STARTERS
# will never cover all cases, but as the gem is named
# 'Pragmatic Segmenter' we need to be pragmatic
# and try to cover the words that most often start a
# sentence but could never follow one of the abbreviations below.
# Rubular: http://rubular.com/r/PkBQ3PVBS8
@language::AbbreviationReplacer::SENTENCE_STARTERS.each do |word|