term_rename
Rename a term everywhere in a .docx as one tracked batch and preview changes with counts before writing; options cover whole-word, case, and inflections.
Instructions
Rename a term everywhere as one tracked batch: whole word, case, preserve case and inflections; dry_run previews with counts. Exact unless match_level folds it; then each change says the level it matched at.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | New term. | |
| doc | Yes | Path to the .docx. | |
| tag | No | Appended to the author. | |
| from | Yes | Term to rename. | |
| author | No | Revision author. | |
| expect | No | ||
| dry_run | No | Plan and preview only; write nothing. | |
| whole_word | No | Whole words only. | |
| inflections | No | Suffixes that follow the term: "s" renames Lucías to Elenas; {"from": "o", "to": "a"} renames Lucíao to Elenaa. | |
| match_level | No | Fold the search as `find` does: `default` ignores case, accents and punctuation (symbols such as `$` still count), `loose` drops symbols too; `exact` is the rename as without it. When passed, Word's Find codes in `from` are read as their characters, each `preview` change and `skipped` row gains `match_level` (the strictest level it meets) and the reply gains `matches_by_level`, adding up to `counts.matches`. No retry at a looser level. Two meanings of exact: without `match_level` the rename is today's, with ^ codes literal and no levels; `match_level: "exact"` keeps that rule but reads the ^ codes and tags each change (`exact` there: character for character). Not with `case_sensitive` or `ignore_accents: false` at a folded level. | |
| preserve_case | No | LUCÍA becomes ELENA, lucía becomes elena, Lucía becomes Elena. | |
| preview_limit | No | Most changes echoed back in `preview`. | |
| case_sensitive | No | Exact spelling only; `to` is used as written. | |
| ignore_accents | No | `Lucia` also matches `Lucía`. |