Skip to content

v0.4.2 — one sentence boundary; fix-sentence says what it fixed

Choose a tag to compare

@chethan62 chethan62 released this 29 Sep 13:52
· 43 commits to main since this release

One sentence boundary, and a fix that says what it fixed.

Fixed

  • The sentence boundary existed twice — a period scan in the API and the
    abbreviation-aware one the stats use — so they disagreed on every title and initial:
    "R. K. Rao go to Mysore." was treated as "Rao go to Mysore." and /v2/fix-sentence
    fixed that fragment. Both come from lt.SentenceRanges now.
  • /v2/fix-sentence answers {fixed, offset, length}: the range it fixed, in UTF-16 code
    units, so a client replaces exactly that text. grammar-ui uses it (without it, a
    fragment replaced by a whole sentence duplicates text: "Dr. Dr. Smith…").
  • Spelling suggestions are no longer applied to names: harper reads "R." as a typo
    (→ "RI") and "Rao" as one (→ "Rad"). A single letter or a capitalised word that is
    not the first in the text is left alone; grammar and typography suggestions still apply,
    so She go to the office. → She goes to the office.
  • The contract is a CI job now (contract), not a thing someone remembers to run: it
    builds, starts the server, waits for /status, and runs examples/lt-client-smoke.py
    against language_tool_python. The harper pin moved into one composite action, since
    two jobs needing it is how a pin drifts.

Verified: full suite, gofmt, vet; live probes for each fix-sentence case; the browser
path ("Dr. Smith wrote teh report. It was late." → one click → "Dr. Smith wrote the report. It was late.", no duplication, the second sentence untouched); CI green on both
jobs.

This archive: grammar-server, harper-ls, harper-cli (the server finds the pair in
its own directory, so nothing needs installing and PATH is irrelevant), the systemd unit,
the UI's three files with their unit, README.md, LICENSE, LICENSE-harper. Extract
and run ./grammar-server.