Supported Formats

snapper classifies text into prose regions (reflowed at sentence boundaries), structure regions (passed through unchanged), and code regions (fenced or delimited source blocks). Code regions keep fence/open/close lines as structure; the body reflows comment lines when [code.<lang>] is configured, and may run an external formatter when --format-code is set. The classification depends on the format.

Org-mode (--format org)

Structure regions (preserved)

  • Non-source #+BEGIN_* …

#+END_* fences, and the bodies of literal blocks (example, export, comment, verse). An unmatched #+BEGIN_EXPORT is a paragraph (org-element export-block-parser)

  • Dynamic blocks (#+BEGIN: NAME … #+END:), including the generated body

  • Quote, center, and special-block (NOTE and other unknown NAME) open/close lines

  • Verse-block body (org-element verse-lines; leftover opaque walker, GitHub #395)

  • Special-block interiors (NOTE, ABSTRACT, WARNING, …) reflow as prose

  • :PROPERTIES: …

:END: drawers

  • #+KEYWORD: directives (TITLE, AUTHOR, DATE, OPTIONS, NAME, ATTR*, etc.); #+CAPTION: / #+CAPTION[short]: opener only

  • Standalone bracket-link lines ([[file:plot.png]])

  • Table rows (lines starting with |)

  • Comment lines (starting with # but not #+ )

  • Column-0 diary-sexp lines (%%(...); org-element-diary-sexp-parser)

  • Full headline lines (stars, optional TODO keyword, and title text)

  • List item markers (-, +, 1., including a tab after the bullet). An ordered marker is one or more digits. A wrap cut that would park it at column 0 skip-cuts the token onto the previous line. Continuation sentences hang at the marker width. One blank line stays inside the item. Two blank lines end the plain list. An item also ends at a line indented less than or equal to its bullet, so a two-space line stays in a column-0 item. A line indented like a child bullet ends that child and stays in the parent

  • LaTeX environments (\begin{equation} … \end{equation}, \begin{align}, etc.). An unmatched \begin{env} is a paragraph (org-element latex-environment-parser)

  • Display math (\[ … \])

  • Line breaks (org-element-line-break-parser: \\ plus optional spaces or tabs at end of line)

  • A line that is only an export snippet (@@latex:\newpage@@). Trailing prose after the closer stays Prose.

Code regions (#+BEGIN_SRC … #+END_SRC)

  • An unmatched #+BEGIN_SRC is a paragraph (org-element src-block-parser)

  • Header and footer lines are structure

  • Body non-comment lines pass through verbatim

  • Body comment lines reflow at sentence boundaries when the language has line_comment and/or block_comment under [code.<lang>]

  • With --format-code, optional formatter argv runs on the body (graceful fallback on failure)

Prose regions (reflowed)

  • Paragraph text

  • List item text (after the marker); continuation sentences hang at the marker width so Org rejoins the item

  • Quote, center, and special-block inner text

  • #+CAPTION: value (org-element-parsed-keywords); continuation sentences hang at the opener width. Dual #+CAPTION[short]: keeps the short title on the opener

Inline tokens (kept atomic)

These tokens within prose are not split across lines:

  • Links: [[url][description]]

  • Angular links: <file:fig. 1.png> (org-link-angle-re; spaces allowed)

  • Emphasis: \*bold*, /italic/, _underline_, +strike+

  • Inline code: ~code~, ==verbatim==

  • A ~code~ or ==verbatim== span may contain the marker character; pairing matches pandoc’s org reader, so x = 1 stays one span

  • Markdown inline code: a run of n backticks closes on the next run of the same length (CommonMark / pandoc), so a double span can hold a single backtick

  • Inline export snippets: @@backend:value@@ (org-element-export-snippet-parser; backend [-A-Za-z0-9]+ so html5 and hyphen names stay one token)

  • Radio targets: <<<contents>>> (org-element-radio-target-parser)

  • Angle targets: <<contents>> (org-element-target-parser)

  • Macros: {{{name}}} / {{{name(args)}}} (org-element-macro-parser)

  • Inline source: src_lang{...} / src_lang[headers]{...} (org-element-inline-src-block-parser; \<src_ is word-start. After a word, _src_ is a subscript, so foo_src_python{...} is not an object; _src_python{...} after space is)

  • Inline babel call: call_name(...) / call_name[inside](...)[end] (org-element-inline-babel-call-parser; same \<call_ / subscript rule)

  • Inline footnotes: [fn:: def] / [fn:name: def] (org-element-footnote-reference-parser)

  • LaTeX fragments: \(...\), $...$, \cmd{arg}, \cmd[opt]{arg} (org-element-latex-fragment-parser; interior backslash and optional [arg] stay one token). Same-line \[...\] is Structure

  • Brace sub/superscripts: H_{2. 0} / x^{n. 1} (org-match-substring-regexp brace arm; interior punct stays one wrap token). Bare H_2 / x^n and no-space H_{2.0} are unchanged. Distinct from latex-fragment.

  • URLs: https://... (trailing sentence punctuation not swallowed)

LaTeX (--format latex)

Structure regions (preserved)

  • Preamble (everything before \begin{document})

  • Non-prose environments: equation, align, alignat, xalignat, xxalignat, empheq, cases, numcases, array, subarray, CD, prooftree, quantikz, yquant, matrix, smallmatrix, multlined, lgathered, rgathered, dmath, tabular, tikzpicture, and their starred variants (plus other non-code envs). \\intertext and \\shortintertext arguments inside those displays stay prose

  • Float chrome (\begin{figure} / \centering / \end{figure}, and table / starred variants): Structure. The \caption long argument is Prose.

  • Extra names from [latex].structure_envs in .snapperrc.toml (for example algorithm)

  • Display math: \[...\]

  • \iffalse through \fi (tree-sitter block_comment)

  • Comment lines (starting with %)

  • \end{document}

  • Full sectioning command lines (\section{...}, \subsection{...}, KOMA \addsec / \addchap / \addpart, including an optional short title and the title text). A wrap cut that would park one of those commands at column 0 skip-cuts the token onto the previous line

Code regions (minted, lstlisting, verbatim, comment, Piton)

  • \\begin{...} / \\end{...} lines are structure

  • fancyvrb Verbatim / Verbatim* / BVerbatim / BVerbatim* / LVerbatim / LVerbatim* / SaveVerbatim / VerbatimOut / fvextra VerbatimWrite / VerbatimBuffer are built-in code regions (same FV@Scan class)

  • verbments.sty pyglist wraps fancyvrb VerbatimOut (raw listing body)

  • texments.sty / pygmentex.sty pygmented is VerbatimEnvironment plus VerbatimOut (raw listing body)

  • fvextra VerbEnv is the environment form of \Verb (raw body through matching \end{VerbEnv})

  • moreverb verbatimtab is a built-in code region (tab-expanding verbatim; same raw class as boxedverbatim)

  • moreverb verbatimwrite writes the env body raw via verbatim@start (same class as VerbatimOut / tcbverbatimwrite)

  • leftover sverb.sty verbwrite / ignore / demo / demo* are the same sv@readenv raw grab

  • moreverb listing / listingcont / listing* / listingcont* are built-in code regions (verbatim@start raw body; starred twins do not expand tabs)

  • alltt (standard alltt.sty) is a built-in code region (raw line breaks)

  • listings.sty lstlisting* is the same raw body scan as lstlisting

  • pythonhighlight.sty python (`lstnewenvironment{python}`) is the same listings raw scan as lstlisting

  • pyluatex.sty pythonq / pythonrepl are verbatim python / REPL bodies (landed python stays Code)

  • showexpl.sty LTXexample (`lstnewenvironment{LTXexample}`) is the same listings raw scan as lstlisting

  • luamplib.dtx mplibcode is the same raw grab class as luacode

  • luacode.sty leftover luaexec is the same raw grab class as luacode

  • codehigh.sty codehigh / demohigh / codehigh* / demohigh* (`NewCodeHighEnv`) are leftover listing envs

  • minted.sty minted* is the starred twin of minted (same raw minted body)

  • tcolorbox listings tcblisting* is the starred twin of tcblisting (same raw listing body)

  • tcolorbox tcbverbatimwrite / tcbwritetemp write the env body raw to a file (same class as VerbatimOut)

  • tcolorbox leftover write/listing envs tcboutputlisting / tcbexternal / dispExample / dispExample* / dispListing / dispListing* are the same raw grab (tcblistingscore / tcbexternal / tcbdocumentation)

  • latexindent filecontents / filecontents* write the env body raw to a file

  • filecontentsdef.sty filecontentsdef writes the env body verbatim into a macro (same raw grab as filecontents)

  • filecontentsdef.sty leftover siblings filecontentsgdef / filecontentsdefmacro / filecontentsgdefmacro / filecontentshere and starred twins filecontentsdef* / filecontentsgdef* / filecontentshere* plus aliases filecontentsdefstarred / filecontentsgdefstarred / filecontentsherestarred are the same raw grab

  • scontents.sty scontents stores the env body verbatim into a sequence; verbatimsc is the package verbatim display env

  • spverbatim.sty spverbatim is a built-in code region (raw line breaks)

  • pythontex.sty pyblock / pyverbatim / pyconsole / pycode* / pyblock* / pyverbatim* / pyconsole* / pygments / sympycode / sympyblock / sympyverbatim / sympyconsole / pylabcode / pylabblock / pylabverbatim / pylabconsole and starred twins, plus leftover default-family pyconcode / pyconverbatim / pysub / pyconsub / sympyconcode / sympyconverbatim / sympysub / sympyconsub / pylabconcode / pylabconverbatim / pylabsub / pylabconsub / pythontexcustomcode, plus option-family usefamily leftovers (rubycode representative; ruby / rb / julia / juliacon / jl / matlab / octave / bash / sage / rust / rs / R / Rcon / perl / pl / perlsix / psix / javascript / js), are the same VerbatimEnvironment class as pycode

  • sagetex.sty sageverbatim / sageexample / sagecommandline are the same verbatim@start class as tree-sitter-latex sagesilent / sageblock

  • piton.sty Piton is a built-in code region (verbatim listing env)

  • Extra names from [latex].verbatim_envs are code regions too

  • Body follows the same comment-reflow and optional --format-code rules as other formats when language is known (minted / minted* language arg, lstlisting / lstlisting* language= option)

  • Inline leftover \verb / \verb* / leftover \lstinline / leftover \spverb / leftover \mintinline / leftover \mint / leftover fancyvrb \Verb / \Verb* / leftover \SaveVerb / leftover \UseVerb / leftover \UseVerbatim / leftover \LUseVerbatim / leftover \BUseVerbatim / leftover \DefineShortVerb / \UndefineShortVerb / leftover fvextra \EscVerb / leftover fvextra \VerbatimInsertBuffer / \VerbatimClearBuffer / \InsertBuffer / \IterateBuffer / \VerbatimInput / \BVerbatimInput / \LVerbatimInput / piton.sty leftover \piton / \PitonInputFile / \PitonInputFileT / \PitonInputFileF / \PitonInputFileTF / listings.sty \lstinputlisting / minted.sty \inputminted / tools/verbatim.sty \verbatiminput / tcolorbox \tcbinputlisting / pythontex.sty \inputpy / \inputpycon / leftover inline \py / \pyc / \pys / \pyb / \pyv / \pycon and twins / \sympy / \pylab and twins / leftover usefamily \ruby / \rb / \julia / \jl / \matlab / \octave / \bash / \sage / \rust / \rs / \R / \perl / \pl / \perlsix / \psix / \javascript / \js and twins / \inputpygments / \pygment / leftover \pythontexcustomc / pythonhighlight.sty \inputpython / \inputpythonfile / leftover \pyth / catchfilebetweentags.sty \CatchFileBetweenTags / \CatchFileBetweenDelims / \ExecuteMetaData / catchfile.sty leftover \CatchFileDef / \CatchFileEdef / moreverb \listinginput / leftover \verbatimtabinput / \verbatimtabinput* / leftover \verbatimwrite / \verbatimwrite* / leftover \listingcont / sagetex \sageinput / leftover inline \sageplot / \sagestr / scontents leftover \Scontents / \Scontents* / \typestored / \getstored / \mergesc / \meaningsc / \foreachsc (and extra [latex].verbatim_commands) stay atomic; inner .!?% do not split or comment. leftover \verb / \verb* / \lstinline / \spverb take a delimiter or, for \lstinline, optional [...] then a delimiter or {...}; spaces after the control word are not the delimiter, so \verb x...x closes on x; a flush following sentence stays on its own line. url.sty \url / \path and hyperref \nolinkurl take a non-brace delimiter the same way (\url|...|); a braced argument stays on the generic command path; a flush following sentence stays on its own line. A width wrap keeps a space inside that delimiter on the same line leftover \mintinline / \mint take optional [...], {lang}, then a delimiter or {...} body; a flush following sentence stays on its own line leftover \SaveVerb takes optional [...], a {name}, then the same delimiter body as \Verb; a flush following sentence stays on its own line leftover \UseVerb / \UseVerb* take optional [...] then a {name}; leftover \UseVerbatim / \LUseVerbatim / \BUseVerbatim take optional [...] then a {name}; a flush following sentence stays on its own line leftover \DefineShortVerb takes optional [...] then a {char}; leftover \UndefineShortVerb takes a {char}; a flush following sentence stays on its own line leftover \Verb takes a delimiter like \verb; leftover \EscVerb takes a delimiter or {code}; a flush following sentence stays on its own line leftover \VerbatimInsertBuffer / \InsertBuffer take optional [...]; leftover \VerbatimClearBuffer takes no args; leftover \IterateBuffer takes optional [...] then a {cmd}; a flush following sentence stays on its own line leftover \piton|...| is verb-like; leftover \piton{...} stays one token via the generic command argument; a flush following sentence stays on its own line \lstinputlisting / \lstinputlisting* take optional [...] then a {filename}; a flush following sentence stays on its own line \inputminted / \inputminted* take optional [...], {lang}, then a {filename}; a flush following sentence stays on its own line \VerbatimInput / \BVerbatimInput / \LVerbatimInput take optional [...] then a {filename}; a flush following sentence stays on its own line \verbatiminput / \verbatiminput* take a {filename}; a flush following sentence stays on its own line \PitonInputFile takes optional <...>, optional [...], then a {filename}; a flush following sentence stays on its own line \PitonInputFileT / \PitonInputFileF take the same optional args then {file} and one extra required brace; \PitonInputFileTF takes two extra braces; a flush following sentence stays on its own line \tcbinputlisting takes one required {keyval} group; a flush following sentence stays on its own line \inputpy / \inputpycon take optional [...] then a {filename}; a flush following sentence stays on its own line \py / \pyc / \pys / \pyb / \pyv / \pycon and twins / \sympy / \pylab and twins take optional [...] then a delimiter or {body}; a flush following sentence stays on its own line \inputpygments takes optional [...], {lang}, then a {filename}; \pygment takes {lang} then a delimiter or {code} body; a flush following sentence stays on its own line \inputpython takes {file} {first} {last}; \inputpythonfile takes {file} then optional [first] [last]; a flush following sentence stays on its own line \pyth takes a delimiter or {code} body; a flush following sentence stays on its own line \CatchFileBetweenTags takes {macro} {file} {tag}; \CatchFileBetweenDelims takes {macro} {file} {start} {end}; \ExecuteMetaData takes optional [file] then {tag}; a flush following sentence stays on its own line leftover \CatchFileDef / \CatchFileEdef take {macro} {file} {setup}; a flush following sentence stays on its own line \listinginput takes optional [interval] then {start} and {filename}; a flush following sentence stays on its own line \verbatimtabinput / \verbatimtabinput* take optional [tabwidth] then a {filename}; a flush following sentence stays on its own line leftover \verbatimwrite / \verbatimwrite* take a {filename}; a flush following sentence stays on its own line leftover \listingcont takes no args; a flush following sentence stays on its own line \sageinput takes optional [...] then a {filename}; a flush following sentence stays on its own line \sageplot takes optional [ltx opts] [fmt] then a {graphics}; \sagestr takes a {code}; a flush following sentence stays on its own line \inputsc takes optional [...] then a {name}; a flush following sentence stays on its own line \pythontexcustomc takes optional [begin|end], a required {type}, then a delimiter or {code} body; a flush following sentence stays on its own line \Scontents / \Scontents* take optional [...] then a standard or verbatim arg; \typestored / \getstored / \mergesc / \meaningsc / \foreachsc take optional [...] then a {seq}; a flush following sentence stays on its own line

Prose regions (reflowed)

  • Body text between structural elements

  • \caption{...} long argument inside figure/table (tree-sitter caption curlygroup)

Markdown (--format markdown)

Structure regions (preserved)

  • Front matter (--- or +++ delimited at file start)

  • Full ATX heading lines (# … ###### including title text)

  • Empty ATX headings (a mark line with no title text) stay Structure

  • Setext headings (title line plus a line of one or more = or - characters). A wrap cut that would park a short underline at column 0 escapes it

  • List item markers (-, \*, +, 1.); continuation sentences hang at the marker width. A line indented four spaces past the marker stays in an open item paragraph. After a blank line it is indented code. A fence, ATX heading, thematic break, HTML block, or GFM table in the marker remainder stays a block

  • Empty list markers (including quoted) stay Structure

  • Definition-list terms and : = markers (pulldown =ENABLE_DEFINITION_LIST); the body hangs at the marker width

  • Blockquote markers (> / nested => > =); continuation sentences repeat the quote prefix

  • GFM alert type markers ([!NOTE] / [!TIP] / [!WARNING] / [!CAUTION] / [!IMPORTANT]); the body hangs and splits like a quote

  • Link-reference definitions ([label]: dest); the destination may sit on the next line. A definition that sits inside a paragraph stays Prose

  • GFM footnote definitions ([^label]:); the marker is Structure and the body hangs

  • Hard line breaks (two trailing spaces, or a trailing backslash)

  • HTML comments (<!-- ... -->, including multiline); <!-- snapper:off --> / <!-- snapper:on --> remain pragmas

  • Type-6 and type-7 HTML blocks run to the next blank line. A matching end tag does not end the block

  • Void type-6 tags (<hr> / <col> / <link> / <base> / <param> / <track>) end on the tag line; they have no closer, so leftover following prose stays Prose even without a blank

  • Pipe tables

Code regions (fenced ``` / ~~~)

  • Opening and closing fence lines are structure. A closing fence may be followed only by spaces or tabs; any other tail stays inside the code block

  • Indented fence bodies preserve indentation on reflowed comment lines

  • Language from the fence info string selects [code.<lang>]; unknown or missing lang passes the body through unchanged (unless --format-code is not applicable without a formatter entry)

Prose regions (reflowed)

  • Paragraph text

  • List item text (after the marker); continuation sentences hang at the marker width

  • Definition-list body (after the =: = marker); continuation sentences hang at the marker width

  • GFM footnote-definition body (after [^label]:); continuation sentences hang at the marker width. An ATX heading in that continuation stays one structure line

  • Blockquote inner text (after the > marker); continuation sentences repeat the quote prefix

Inline tokens (kept atomic)

  • Emphasis: \*em*, \*\*strong** (CommonMark flanking; a period inside the span does not split)

  • Strikethrough: ~~strike~~ (GFM)

  • Inline code: a run of n backticks closes on the next run of the same length

  • Links and images: [text](url), ![alt](url)

  • Inline math: $...$ / $$...$$

reStructuredText (--format rst)

Structure regions (preserved)

  • Non-code opaque directives (.. math::, .. image::, .. raw::, .. include::, .. csv-table::) and their indented bodies

  • Container directive openers (.. note::, .. warning::, .. figure::, .. topic::, .. sidebar::, .. container::, leftover .. parsed-literal::, .. epigraph::, .. highlights::, .. pull-quote::, .. compound::, .. header::, .. footer::) and their :option: fields; the indented body is prose

  • Same-line body after :: on those containers, leftover .. parsed-literal::, .. header::, .. footer::, .. |name| replace::, and .. meta:: fields hangs and splits. Flush bibliographic fields close a meta leftover

  • Literal blocks (text after :: with indented or line-prefix-quoted content). A paragraph whose text is only :: is that marker. A two-character title underlined with :: stays a section

  • Section titles and underlines (===, -----, etc.). A wrap cut that would park a solid Docutils Body.line adornment at column 0 skip-cuts the token onto the previous line (snapper-7xd3) A wrap cut that would park a Docutils simple-table border at column 0 skip-cuts the token onto the previous line (snapper-2knx) A wrap cut that would park a Docutils grid-table top (+---+) at column 0 skip-cuts the token onto the previous line A wrap cut that would park a Jinja statement (\{% ... %\}) or a Docutils anonymous target (__ uri) at column 0 skip-cuts the token onto the previous line. The indented link block under that target stays structure until a blank A wrap cut that would park a leftover plus fragment (+===+, +foo) at column 0 skip-cuts the token onto the previous line

  • Field lists (:Author:, :Date:, etc.)

  • Empty list items, empty doctest openers, and empty field-list markers at EOL stay Structure

  • Comments (.. without a directive)

  • Grid and simple tables (lines starting with | or +)

Code regions (.. code-block:: LANG)

  • Directive line and trailing blank handling stay structure

  • Indented body uses the language token for [code.<lang>] comment reflow and optional --format-code

Prose regions (reflowed)

  • Paragraph text between structural elements

  • Indented bodies of container directives (admonitions, figure captions, topic, sidebar, container, leftover parsed-literal, epigraph, highlights, pull-quote, compound); hang spaces stay structure

Inline tokens (kept atomic)

  • Substitution references: |fig. 1| / |version| / |name|_ / |name|__ (Docutils Inliner.substitutionref). Interior punctuation is not a sentence or wrap boundary. The use stays Prose, not Structure (line-block is | plus space or EOL)

Auto-detection

Extensions: .rst, .rest

Typst (--format typst)

Native markup for .typ files. Pandoc’s typst reader is still available with --use-pandoc. The default path does not call pandoc.

Structure regions (unchanged)

  • Column-0 headings (one or more equals signs, then a space or end of line)

  • Statement lines: #let, #set, #show, #import, #include, #context, #export, #return

  • Unclosed code calls, such as #figure( and #align(center)[

  • Content closers (], ),) and the lines that follow while a group stays open

  • Line comments (//) and block comments (/* */)

  • Display math: a line whose text is $, or a single line $ ... $

  • // snapper:off / // snapper:on and /* snapper:off */

Code regions (raw fences)

  • Three or more backticks, with an optional language tag

  • Fence lines stay fixed

  • Comment lines reflow when [code.<lang>] is set

Prose regions (reflowed)

  • Paragraphs

  • List and term bodies, hung at the marker

  • Bodies of content blocks, hung at their indent

  • A closed content call on a prose line (#emph[Dr. Smith.]) stays in the sentence

Inline tokens (kept atomic)

  • Math $E = m c^2$

  • Strong \*...* and emphasis _..._

  • Labels <intro> and references @fig.1

  • # calls, // comments, and raw backticks

Auto-detection

Extensions: .typ, .typst. A path with one of those extensions is Typst even when the text looks like another format.

With no path, snapper scores the whole document. Lines inside a closed backtick fence are ignored, and a marker is a fence only when a matching closer exists. A ~ line is not a fence, because ~ is a non-breaking space in Typst. A heading inside a backtick fence is not a heading.

A Typst signal is a statement Typst 0.15.1 accepts to the end of that statement. A #let or #set counts when its parentheses close and the right-hand side is finished, including #let x = 1 + 2. An unclosed parenthesis keeps the following lines inside that statement, so a later #set there is not a separate signal. Delimiters and hashes count in code, outside strings and comments. Each opener closes on its matching closer, and a mismatched closer in code ends that statement. A parenthesis or brace inside a content block is markup, so the code bracket stays open. An unclosed string keeps the following lines inside that string. Block comments nest, and a line comment ends on its own line. A dotted selector names a real element, and a show body is a name that compiles in that position. #show: h, #show heading: h, and #let ieee( bring the figures. are not signals. A hyphenated word such as #import-export is one identifier, not a keyword.

Plaintext (--format plaintext)

Everything is prose. Blank lines are preserved as paragraph separators.

Sentence Detection

snapper uses Unicode UAX #29 sentence boundary detection as a baseline (or optional --neural / nnsplit), then applies the same post-pipeline: abbreviation merges, then delimiter-span rejoin so dialogue and balanced ()[]{} spans are not fractured.

Delimiter-span policy (residual cases)

  • Balanced ASCII/curly/guillemet quotes, LaTeX double-backtick quotes, and ()[]{} must not gain a semantic line break mid-span (see tests/sentence_delim_props.rs).

  • Unclosed " (or open ‘ without ’) glues the rest of the paragraph; snapper does not invent closers.

  • Nested semantic ASCII quotes (say "hi" now with an inner pair) remain toggle-ambiguous; prefer typographic quotes or escapes in source.

  • Apostrophes in contractions (don't, it's) are not treated as dialogue openers.

  • Markdown fences (three backticks) are not treated as LaTeX double-backtick openers.

  • --neural runs the same abbreviation + span post-pipeline after the model proposes cuts (English papers can still prefer the rules path for fully offline, deterministic CI).

snapper merges false splits caused by known abbreviations:

Titles

Mr., Mrs., Ms., Dr., Prof., Sr., Jr., St., Rev., Gen., etc.

Academic

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

Latin

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

Single initials

A., B., C., … Z.

Date and time

Jan., Feb., …, Dec., Mon., Tue., …, Sun., a.m., p.m.

Quoted and parenthesized punctuation

Sentence punctuation inside quotes or parentheses does not trigger a false split when the next word starts lowercase. For example, He said "wow!" and left. stays on one line because "!" followed by lowercase and signals a continuation, not a new sentence. Patterns handled: !", ?", .", !), ?), .), and similar combinations with single quotes or brackets.