Skip to content

Brazilian to European Portuguese v1.8.2: managed local grammar checks and rule selection - #363

Merged
niksedk merged 7 commits into
SubtitleEdit:mainfrom
SMAP-git:ptpt-v1.8.2-managed-grammar
Nov 11, 2026
Merged

niksedk merged 7 commits into
SubtitleEdit:mainfrom
SMAP-git:ptpt-v1.8.2-managed-grammar

Conversation

@SMAP-git

Copy link
Copy Markdown
Contributor

Summary

Builds on the already merged baseline PR #362. Updates only the Brazilian to European Portuguese plugin and its tests to v1.8.2.

  • Add optional local LanguageTool pt-PT checking, disabled by default, after existing deterministic conversion rules. Review-first diagnostics; no generative rewriting.
  • Explicit plugin download buttons install pinned, SHA-256-verified LanguageTool 6.6 and a private Eclipse Temurin JRE 21.0.13+9. Portuguese rules are included. No system Java/PATH changes. Licences remain with the distributions.
  • Own a loopback-only checker on an available port, automatically started and stopped for checks, including cancellation/window-close cleanup. Optional advanced external-server mode; public LanguageTool cloud endpoints are not supported.
  • Add saved alert-group and individual rule selection, a Grammar only preset, and a separate Grammar warnings display filter. Choices apply consistently to preview, batch and grammar rechecks.
  • Narrow optional automatic fixes: explicit ele/ela/eles/elas agreement with tem/têm or vem/vêm only. Require enabled agreement rules, matching aligned English subject, installed/enabled MiniLM, meaning safeguards and successful grammar recheck. Both checker modes support this; all other suggestions stay review-only.
  • Preserve protected markup, ignored/custom words and cue boundaries. Safe sentence checks reuse existing same-speaker/selection/timing protections; bounded requests and explicit failures retain deterministic output rather than partial optional changes.
  • Reposition reference/model controls below top-right actions beside orthography, align dialogue/layout and dictionary right edges, and preserve review space through bounded scrolling.
  • Include guarded restrictive-adverb command fixes (Só lembra-te → Lembra-te só), wrapped possessive article protection (do + newline + meu, not do o meu), and resultative anatomical injury wording (ficou lesionada) without rewriting explicit-agent passives.

Validation

  • Exact upstream branch: full native-UI suite, 5,475 passed / eight optional integration tests skipped.
  • Earlier actual downloaded LanguageTool/Java runtime validation on Linux x64 covered pt-PT findings, startup, normal shutdown and cancellation; published executable also passed a real managed-server batch smoke test.
  • Published executable verified S08E02 cues 659 and 305; all 902 cue IDs/timings and source hashes preserved.
  • Before subsequent explicit deterministic fixes, grammar-disabled v1.8.1 output matched v1.7.0 across 22 episodes / 18,625 cues.
  • Linux self-contained publish and git diff --check pass. Earlier integration CI built all six release targets.

Platform and accuracy limits

Managed runtime execution has only been verified on Linux x64, not Windows/macOS or Flatpak. Native Java packages cover Linux/macOS x64 and ARM64, and Windows x64; Windows ARM64 deliberately uses x64 Java via OS emulation. Actual MiniLM inference was not exercised in candidate-gate tests (deterministic vectors). No full-corpus real LanguageTool accuracy/performance certification is claimed. Grammar checking and auto-fixes remain separate opt-ins.

Rollback

The standalone repository main now contains this version. Its experimental PR is closed. The pre-grammar v1.7.0 tag/release remains available: https://github.com/SMAP-git/BrazilianToEuropeanPortuguese/releases/tag/v1.7.0

SMAP-git and others added 7 commits November 11, 2026 16:22
Keep v1.7.0 as the rollback baseline and isolate the v1.8.0 experiment. Add a bounded LanguageTool client, review-first diagnostics, explicit-subject agreement allowlist, aligned English and MiniLM safeguards, candidate rechecks, and shared preview/batch settings. No model or Java installation, public cloud API or generative rewriting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add verified LanguageTool and portable Java downloads, owned loopback server lifecycle, and advanced external-server mode. Preserve real grammar phrase suggestions and subtitle boundaries. Move reference/model settings beside dialogue/layout and document the opt-in v1.8.1 workflow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a grammar-only preset and per-rule exclusions for spelling, dialogue typography, style and other findings. Persist selections for preview and batch, filter rechecks consistently, and send explicit rule exclusions to LanguageTool. Include native dialog, settings and protocol regression tests; update experimental version to 1.8.2.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move reference settings below the top-right actions, align dialogue/layout and dictionary right edges, and bound scrolling to preserve subtitle-review space. Validate native layout at minimum, standard and wide widths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Classify LanguageTool findings independently of other review warnings while preserving multi-type rows, edits and Apply selections. Verify classification and native filter controls.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Normalize Só lembra-te to Lembra-te só and equivalent apenas/somente commands without moving adverbs in indicative, negative or subordinate uses. Reuse finite-clitic and imperative morphology, cover dialogue dashes and case, update the earlier exception tests and document the pt-PT rule. Verified episode S08E02 cue 659 through the published executable with all 902 cue IDs and timings preserved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve existing articles across subtitle line breaks and prefer guarded resultative ficar for anatomical injuries. Clarify that tested agreement fixes work with managed and external grammar checkers. Validated 5,475 tests and actual S08E02 cue 305 with IDs, timings and source preserved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@niksedk
niksedk merged commit 968c38b into SubtitleEdit:main Nov 11, 2026
9 checks passed
@niksedk

niksedk commented Nov 11, 2026

Copy link
Copy Markdown
Member

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants