Abbreviation Handling

How abbreviation detection works

Snapper uses Unicode UAX #29 sentence boundary detection as a baseline. UAX #29 sometimes splits at periods that belong to abbreviations rather than sentence endings. Snapper post-processes the split results, merging segments where the break occurred at a known abbreviation.

Select a language with --lang to use the appropriate abbreviation set:

snapper --lang de paper.tex    # German abbreviations
snapper --lang fr article.md   # French abbreviations

Available languages: en (default), de, fr, is, pl. Set in config: lang = "de" in .snapperrc.toml.

Built-in abbreviations (English, default)

Titles and honorifics

Mr., Mrs., Ms., Dr., Prof., Sr., Jr., St., Rev., Gen., Gov., Sgt., Cpl., Pvt., Capt., Lt., Col., Maj., Cmdr., Adm.

Academic and scientific

Fig., Figs., Eq., Eqs., Ref., Refs., Tab., Sec., Ch., Vol., No., Nos., Ed., Eds., Trans., Dept., Thm., Lem., Prop., Def., Cor., Rem., Ex.

Latin

e.g., i.e., et al., cf., etc., viz., ibid., ca., approx., v.s.

Time and dates

Jan., Feb., Mar., Apr., Jun., Jul., Aug., Sep., Oct., Nov., Dec., Mon., Tue., Wed., Thu., Fri., Sat., Sun., a.m., p.m.

Common

vs., misc., est., govt., dept., univ., inc., corp., ltd., Ave., Blvd., Rd., pp., pg., pt., pts.

Single-letter initials

  1. through Z. (for names like J. K. Rowling).

Journal titles (every language)

Reference lists print journal titles in ISO 4 form, as a run of abbreviated words (J. Chem. Phys., SIAM J. Sci. Comput., ACM Trans. Math. Softw.). ISO 4 abbreviates the same words whatever the language, so this list applies under every --lang:

Acad., Adv., Am., Anal., Angew., Annu., Appl., Arch., Astron., Astrophys., Biochem., Biol., Biophys., Bull., Catal., Chem., Chim., Clin., Comb., Commun., Comp., Comput., Crystallogr., Curr., Electrochem., Electron., Eng., Environ., Eur., Exp., Geophys., Ind., Inf., Inorg., Instrum., Int., Jpn., Lett., Lond., Macromol., Mater., Math., Mech., Med., Microsc., Mol., Nanotechnol., Natl., Nucl., Numer., Opt., Optim., Philos., Photochem., Phys., Polym., Proc., Psychol., Rep., Res., Sci., Ser., Simul., Soc., Softw., Spectrosc., Stat., Struct., Surf., Syst., Technol., Theor., Thermodyn.

Words that also end ordinary sentences (Front., Org., Ann.) are left out. A run still holds across them: a capitalised word and its period stay joined to the next piece when that piece opens with a listed journal word, so Front. Chem. 8 and J. Org. Chem. stay on one line. A title or a figure reference after the period still opens a sentence, so We used Python. Fig. 3 shows splits. Add a missing journal word with extra_abbreviations.

German abbreviations (--lang de)

Hr., Fr., Dr., Prof., Abb., Bd., Hrsg., Kap., Nr., S., Verl., Aufl., Jg., Anm., Anh., Beil., Tab., Gl., Abschn., Bsp., Str., Pl., bzw., ca., etc., evtl., ggf., vgl., usw.

Multi-word: z.B., d.h., u.a., o.g., s.o., u.U.

French abbreviations (--lang fr)

M., Mme., Mlle., Dr., Prof., Me., fig., eq., chap., vol., p., pp., ed., trad., n., t., av., apr., env., cf., etc.

Multi-word: c.-a-d., p.ex.

Icelandic abbreviations (--lang is)

Hr., Fr., Dr., sbr., frk., sk., nr.

Multi-word: m.a., o.fl.

Polish abbreviations (--lang pl)

dr., mgr., prof., doc., rys., tab., wyd., red., t., s., nr., poz., zob., por., ul., al., pl., os.

Multi-word: m.in., t.j., j.w., t.zw., b.r.

Adding project-specific abbreviations

Create a .snapperrc.toml in your project root:

extra_abbreviations = ["GROMACS", "LAMMPS", "DFT", "VASP", "Abstr", "Suppl"]

These merge with the built-in list at runtime.

Inline token protection

Periods inside inline tokens never trigger sentence breaks, regardless of abbreviation lists:

  • Org links: [[https://example.com][Ex. Site]]

  • Org macros: {{{cite(Smith. 2020)}}}, {{{title}}}

  • Org radio / angle targets: <<<the Fourier. transform>>>, <<sec. intro>>

  • Org inline footnotes: [fn:: the Fourier. transform], [fn:note: the Fourier. transform]

  • RST substitution references: |fig. 1|, |version|, |name|_, |name|__

  • LaTeX math: $x = 3.14$, \( x = 1. \), \(\alpha. \beta\)

  • LaTeX commands: \cite{smith.2024}, \sqrt[2]{a. b}

  • Markdown links: [Example Inc.](url), [the Fourier. transform][wiki]

  • Inline code: ~std.io.Read~,

These tokens get replaced with safe placeholders before sentence detection and restored afterward.