Matching

com.alecdorrington.annotatedtextformat.llm.Matching
See theMatching companion object
final case class Matching(anyCase: Boolean = ..., anySpacing: Boolean = ..., anyQuotes: Boolean = ..., wholeWords: Boolean = ...)

How loosely a part of a quote may match the text, as a model may quote it a little otherwise than it is written. QuotedAnnotation.anchor tries the text as it is quoted first, and only then as loosely as this allows.

Letters are matched in either case by folding each character to lower case, alike on the JVM and in JavaScript; so "kiz" never matches "kız", and neither does "σ" match "ς", the final sigma. Text is not normalised, so a letter written with a combining accent does not match one written as a single character. Since a quote as written is sought before a looser match, an exact match further on is preferred to a nearer loose one: a straight don't quoted for a curly don’t is placed on a later straight one, if there is one.

Value parameters

anyCase

Whether letters match in either case.

anyQuotes

Whether each apostrophe matches any, and each double quotation mark any.

anySpacing

Whether words match with any whitespace between them, and punctuation with or without whitespace beside it, as a model may space a full stop.

wholeWords

Whether a part beginning or ending with a word matches only a whole word there, not part of one, as one joined to it by an apostrophe or hyphen, in scripts that end their words where their letters do.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

It, matching only text written exactly as quoted, but as to whole words.

It, matching only text written exactly as quoted, but as to whole words.

Attributes

def find(part: String, text: String): List[Found]

Where part, a part of a quote, is in text, in order, overlapping matches included; nowhere if there is nothing in it to match but markers.

Where part, a part of a quote, is in text, in order, overlapping matches included; nowhere if there is nothing in it to match but markers.

Attributes

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product