/** * CopyEditor — PROC-06 Copy Editing Support * * Analyses chapter Markdown files for common copy-editing issues: * - POV slips (third-person-limited violations) * - Tense shifts (mixed past / present within a paragraph) * - Name variants (misspellings or unexpected abbreviations of known names) * - Filter-distance phrases (secondary signal — covered by ProseAnalyzer but * re-surfaced here at copy-edit severity) * * All analysis is performed on plain text after stripping YAML frontmatter and * Markdown code fences. File I/O is the only async operation; the core * detection methods are synchronous and publicly exposed for unit testing. */ export type CopyEditIssueType = 'pov_slip' | 'tense_shift' | 'name_variant' | 'filter_distance'; export interface CopyEditIssue { type: CopyEditIssueType; /** 1-based line number within the file (including frontmatter lines). */ line: number; /** The verbatim text that triggered the flag. */ text: string; /** Human-readable explanation. */ note: string; severity: 'warning' | 'error'; } export interface CopyEditResult { chapterFile: string; issues: CopyEditIssue[]; } /** * Strip YAML frontmatter (a `---` … `---` block at the very start of the * file). Returns the raw text with the frontmatter replaced by the same number * of blank lines so that 1-based line numbers remain valid. */ export declare function stripFrontmatter(raw: string): string; export declare class CopyEditor { private readonly projectPath; constructor(projectPath: string); /** * Run all enabled copy-edit checks on a chapter Markdown file. * * @param chapterFile - Absolute path, or a basename resolved relative to * `projectPath/chapters/`. * @param options - Optional detection settings. * @param options.povCharacter - Name of the POV character; enables POV-slip * detection when provided. * @param options.expectedTense - 'past' or 'present'; enables tense-shift * detection when provided. * @param options.knownNames - List of canonical character / place names; * enables name-variant detection when provided. */ analyzeChapter(chapterFile: string, options?: { povCharacter?: string; expectedTense?: 'past' | 'present'; knownNames?: string[]; }): Promise; /** * Run all enabled checks on raw file text. Strips frontmatter before * analysis but preserves line numbers. * * Exposed as a public method so unit tests can call it without file I/O. */ _analyzeText(raw: string, options?: { povCharacter?: string; expectedTense?: 'past' | 'present'; knownNames?: string[]; }): CopyEditIssue[]; /** * Flag lines where a character name OTHER than `povCharacter` appears on the * same line as a thought / perception verb (`thought`, `felt`, `knew`, etc.). * * Heuristic: we tokenise each line into words, look for a thought verb, and * check whether any neighbouring word (within 5 positions) is a capitalised * word that differs from the POV character's first name. If so, we flag it. * * Only lines that are NOT inside YAML frontmatter (already stripped) or code * fences are considered. */ _detectPovSlips(text: string, povCharacter: string): CopyEditIssue[]; /** * For each paragraph in `text`, count past-tense and present-tense verb * markers. Flag paragraphs where the minority tense constitutes more than 20% * of the total verb count and at least 1 minority verb is present. */ _detectTenseShifts(text: string, expectedTense: 'past' | 'present'): CopyEditIssue[]; /** * For each known name, scan the text for capitalised words whose first 4 * characters match the name's first 4 characters but whose full spelling * differs. Also flag words within Levenshtein distance 1 of the known name. * * Known names themselves are excluded from flagging (exact case-insensitive * match). */ _detectNameVariants(text: string, knownNames: string[]): CopyEditIssue[]; } //# sourceMappingURL=copy-editor.d.ts.map