Class CompareOptions
How DocumentComparer aligns two documents and what it writes into the result.
Every option that could otherwise vary between runs is caller-supplied. There is no ambient clock and no generated id: the same two documents compared twice with the same options produce byte-identical output.
public sealed class CompareOptions
- Inheritance
-
CompareOptions
- Inherited Members
Constructors
Properties
- Author
Gets or sets the author recorded on every generated revision. Never null or empty; assigning either throws.
- Granularity
Gets or sets whether runs are aligned by word or by character.
- IgnoreCase
Gets or sets whether text compares case-insensitively. The comparison is OrdinalIgnoreCase — invariant, so the result does not depend on the machine's culture.
- IgnoreFormatting
Gets or sets whether formatting differences are ignored entirely. When false, a difference in formatting alone produces a w:rPrChange or w:pPrChange rather than a deletion and an insertion.
- IgnoreWhitespace
Gets or sets whether runs of whitespace compare equal regardless of length and kind. Alignment only; the revised document's own spacing is what the result carries.
- MaxAlignmentCells
Gets or sets the largest LCS table, in cells, the comparer will build. Beyond it the alignment falls back to a bounded two-pointer resynchronization, which is linear and finds a good alignment rather than the optimal one; AlignmentFellBack reports that it happened.
The default matches the visual harness's glyph alignment, which has run against this ceiling since Phase 4.
- MaxBlocks
Gets or sets the total number of blocks either document may contain before the comparison refuses to start. Unlike MaxAlignmentCells this is a hard stop, not a fallback: it throws ResourceLimitExceededException.
- MaxTokensPerParagraph
Gets or sets the number of tokens a single paragraph may produce before the comparison refuses to continue. A hard stop, for the same reason as MaxBlocks.
- MinimumMoveLength
Gets or sets the shortest paragraph, in characters, that may be reported as a move. Guards against boilerplate — a document full of identical short paragraphs would otherwise produce a move for each one.
- MinimumParagraphSimilarity
Gets or sets how alike two paragraphs must be, from 0 to 1, before the comparer diffs them against each other instead of calling one deleted and the other inserted.
Exact alignment finds only paragraphs that did not change at all, so without this every edited paragraph — the ordinary case — would be marked as a wholesale replacement and the run-level alignment would never run. The score is the share of tokens the two have in common, counted at the configured Granularity.
- MoveDetection
Gets or sets how a moved paragraph is represented.
- StartingRevisionId
Gets or sets the first w:id assigned to a generated revision. Ids then count up.
- Timestamp
Gets or sets the raw w:date value written on every generated revision, or null to write none. Supplied verbatim and never parsed, so the caller decides the format and the result stays deterministic — a comparer that read the clock could not be byte-compared against anything.