Skip to content

Instantly share code, notes, and snippets.

@aih
Created December 14, 2021 22:14
Show Gist options
  • Save aih/772bb0fe0feb2f86eafb730248c5d73d to your computer and use it in GitHub Desktop.
Save aih/772bb0fe0feb2f86eafb730248c5d73d to your computer and use it in GitHub Desktop.
Base options to use in xcdiff
{
// Selectors for mapping sections in document:
// `key` is a selector to match section
// `value` is an array of element selectors to exclude
// from matched section content. Pass empty array or `null`
// to include full content
match: ['xml-meta', 'division', 'part', 'title', 'subtitle', 'chapter', 'section', 'intermediatelevel', 'majorlevel'],
//match: ['part', 'title', 'subtitle', 'chapter', 'section', 'toc', 'tocItem', 'docTitle', 'preamble', 'level', 'recital', 'resolutions', 'conclusions', 'regulation', 'table'],
// Selectors to ignore sections matched by `match` option
ignore : ['section//section', 'section//division', 'section//part', 'section//title', 'section//subtitle', 'section//chapter'],
// More accurate, but slower section match
fullScan: true,
addLocations : true,
skipSpace: true,
similarity: true,
// Array of manual `[from, to]` section mappings.
// For example, `[ [3, 1] ]` will map third section of `from`
// document to first section of `to` document.
// Indexes as 1-based, see section markers for matched indexes.
// If set, enabled `fullScan` by default
mapping: null,
minScore: 0.8,
maxScore: 1,
normalize: true,
wordPatches: true,
dmp: {
Diff_Timeout: 0,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment