8000 A paragraph that opens with an ordinal is counted as one sentence · Issue #51 · kiran-brahma/writing-tool · GitHub
[go: up one dir, main page]

Skip to content

A paragraph that opens with an ordinal is counted as one sentence #51

Closed

Description

@kiran-brahma

What

A Paragraph that opens with an ordinal and continues as a sentence — 1984. The year Orwell chose. —
is counted as one sentence by the rhythm metrics, not two.

  • src/core/canonicalText.ts — escapeBlockStart escapes the period, correctly: parseCanonical
    would otherwise read the line as an ordered list (isOrderedStart is /^\d+\.(?:\s|$)/). The
    escaped canonical text is 1984\. The year Orwell chose.
  • src/core/sentences.ts — collectSentences skips a period preceded by a backslash, because that
    is how an escaped ordered-list marker (1\. not a list) reaches it.

documentMetrics, matchRepetition and the opener rules all compute over that segmentation.

Why it is genuinely undecidable as written

1. not a list and 1984. The year… are byte-identical in shape: digits, a period, a space, then
prose. The canonical string cannot distinguish "marker the Writer did not mean" from "sentence the
Writer did mean". A deterministic rule has to pick one, and the file already documents that it is a
rule and not a grammatical analysis.

Current state

Scoped, not solved: the guard now only applies to a leading ordered-marker escape, so a period
after a literal backslash inside prose (a \\. Then) does split. The line-start case above remains,
and the code comment says so.

Options for a human

  1. Accept it and document it where the Writer can see it (the metrics panel's own explanation).
  2. Disambiguate at the source: escape the digits rather than the period for the prose case, so the
    two escapes become distinguishable. This changes the canonical string for such Paragraphs, so
    stored anchor offsets move — resolveAnchor re-locates by quote, but it is a storage-adjacent
    change that deserves its own review and possibly a migration note.

Origin

Found by the Thermos review (thermo-nuclear F1); partly fixed, this is the residual.

Activity

  1. kiran-brahma commented on Sep 26, 2026

    @kiran-brahma
    OwnerAuthor

    Decision (Writer, 2026-09-26): option 1, accept and document. Keep the deterministic rule. Say plainly in the metrics panel's own explanation that a Paragraph opening with a number and a period (1984. …) is read as one sentence. Do not change the canonical string, so no stored anchor offsets move. Acceptance: the explanation text states the limitation and is asserted in the help content tests; sentences.ts behaviour unchanged.

  2. added
    ready-for-agentSpec is ready for an agent to implement
    and removed on Sep 26, 2026
  3. kiran-brahma commented on Sep 26, 2026

    @kiran-brahma
    OwnerAuthor

    Done in #72 (merged into v1.3), per option 1: the metrics gloss states the limitation and is asserted in the help tests; sentences.ts behaviour unchanged.

    Side note from the worker: typing 1984. at a line start in the Editor turns it into a numbered list (Markdown input rule), so the live Editor usually produces a list rather than this paragraph case. Worth its own ticket if that conversion is unwanted.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentSpec is ready for an agent to implement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0