TAN-core-string global variables, keys, and functions summarized

Definition: '\P{M}\p{M}*'

Used by function tan:chop-string()

Does not rely upon global variables, keys, functions, or templates.

Option 1 (TAN-core-string-functions)

tan:collate($strings as xs:string*) as element()

one parameter version of full one below

Used by function tan:collate()

Relies upon tan:collate .

Option 2 (TAN-core-string-functions)

tan:collate($strings as xs:string*, $labels as xs:string*) as element()

Input: any number of strings

Output: an element with <c> and <u w="[WITNESS NUMBERS]">, showing where there are common strings and where there are departures. At the beginning are <witness>es identifying the numbers, and providing basic statistics about how much each pair of witnesses agree.

This function was written to deal with multiple OCR results of the same page of text, to find agreement wherever possible.

Used by function tan:collate()

Relies upon tan:diff tan:collate-loop-outer ŧ diff-to-collation .

Option 1 (TAN-core-string-functions)

tan:diff($string-a as xs:string?, $string-b as xs:string?) as element()

2-param version of fuller one below

Used by template ŧ class-1-expansion-verbose

Used by function tan:diff() tan:collate() tan:collate-loop-inner()

Relies upon tan:diff .

Option 2 (TAN-core-string-functions)

tan:diff($string-a as xs:string?, $string-b as xs:string?, $snap-to-word as xs:boolean) as element()

Input: any two strings; boolean indicating whether results should snap to nearest word

Output: an element with <a>, <b>, and <common> children showing where strings a and b match and depart

This function was written after tan:diff, intended to be a cruder and faster way to check two strings against each other, suitable for validation without hanging due to nested recursion objections.

Used by template ŧ class-1-expansion-verbose

Used by function tan:diff() tan:collate() tan:collate-loop-inner()

Relies upon tan:diff-loop tan:group-adjacent-elements ŧ snap-to-word-pass-1 .

Option 1 (TAN-core-string-functions)

tan:normalize-text($text as xs:string*) as xs:string*

one-parameter version of full function below

Used by template ŧ check-referred-doc ŧ expand-tan-key-dependencies core-expansion-terse ŧ core-expansion-normal ŧ resolve-attr-include

Used by function tan:feature-test-to-groups() tan:resolve-doc() tan:normalize-text()

Relies upon tan:normalize-text .

Option 2 (TAN-core-string-functions)

tan:normalize-text($text as xs:string*, $render-common as xs:boolean) as xs:string*

Input: any sequence of strings; a boolean indicating whether the results should be normalized further to a common form

Output: that sequence, with each item's space normalized, and removal of any help requested

A common form is one where the string is converted to lower-case, and hyphens are replaced by spaces

Used by template ŧ check-referred-doc ŧ expand-tan-key-dependencies core-expansion-terse ŧ core-expansion-normal ŧ resolve-attr-include

Used by function tan:feature-test-to-groups() tan:resolve-doc() tan:normalize-text()

Relies upon $help-trigger-regex .

Option 1 (TAN-core-string-functions)

tan:tokenize-text($text as xs:string*) as element()*

one-parameter version of the function below

Used by template ŧ tokenize-div ŧ dependencies-tokenized-selectively ŧ dependency-expansion-normal ŧ dependency-expansion-verbose

Used by function tan:tokenize-text()

Relies upon tan:tokenize-text $token-definition-default .

Option 2 (TAN-core-string-functions)

tan:tokenize-text($text as xs:string*, $token-definition as element(tan:token-definition)?, $count-toks as xs:boolean?) as element()*

Input: any number of strings; a <token-definition>; a boolean indicating whether tokens should be counted and labeled.

Output: a <result> for each string, tokenized into <tok> and <non-tok>, respectively. If the counting option is turned on, the <result> contains @tok-count and @non-tok-count, and each <tok> and <non-tok> have an @n indicating which <tok> group it belongs to.

Used by template ŧ tokenize-div ŧ dependencies-tokenized-selectively ŧ dependency-expansion-normal ŧ dependency-expansion-verbose

Used by function tan:tokenize-text()

Relies upon $token-definition-default .