Return true when the . at text[dotIndex] is the trailing dot of a known abbreviation rather than a real sentence terminator.
Looks back from the dot position to the first whitespace boundary, collecting the full preceding token โ including any internal dots. This allows multi-dot abbreviations like e.g., i.e., U.S., bl.a., d.v.s. to be detected in addition to simple ones like prop. and Mr.
Normalisation strategy (applied in order):
Lower-case the full token and strip all internal dots; look up the dotless form (e.g โ eg, d.v.s โ dvs). This covers most multi-dot abbreviations whose canonical form is in the set.
If the dotless form is not in the set but the token contains internal dots, check the first dot-split component (bl.a. โ bl). Only the first component is checked to prevent a non-abbreviation prefix from accidentally matching a set member that appears later in the token (e.g. example.al. must not be treated as an abbreviation even though al is in the set).
Return
truewhen the.attext[dotIndex]is the trailing dot of a known abbreviation rather than a real sentence terminator.Looks back from the dot position to the first whitespace boundary, collecting the full preceding token โ including any internal dots. This allows multi-dot abbreviations like
e.g.,i.e.,U.S.,bl.a.,d.v.s.to be detected in addition to simple ones likeprop.andMr.Normalisation strategy (applied in order):
e.gโeg,d.v.sโdvs). This covers most multi-dot abbreviations whose canonical form is in the set.bl.a.โbl). Only the first component is checked to prevent a non-abbreviation prefix from accidentally matching a set member that appears later in the token (e.g.example.al.must not be treated as an abbreviation even thoughalis in the set).Pure function โ exported only for testability.