Expand description
Text helpers shared by the parser, diagnostics and docs: matching keys, slugs, numbers.
Functions§
- closest
- The candidate closest to
word, if it’s close enough to be a plausible typo. - edit_
distance - Levenshtein distance, for “did you mean” suggestions.
- join_
and - “a”, “a and b”, “a, b and c”.
- key
- The matching key of a phrase: normalised, without a leading article.
- normalize
- Lowercase, collapse whitespace and drop a trailing full stop, for matching step text.
- number
- Numbers as people write them: 55 rather than 55.0, 77.5 rather than 77.500.
- paragraphs
- Description lines as paragraphs: lines joined with spaces, an empty line between paragraphs.
- slug
- A file-name and anchor friendly form: “Turn it up!” -> “turn-it-up”.