AnnotatedText

com.alecdorrington.annotatedtextformat.AnnotatedText
See theAnnotatedText companion object
final case class AnnotatedText[+A]

A text with annotations, each attaching a value to some of its spans. Annotations may overlap and nest one another, but each has at least one span, and its own spans lie within the text, in order, none overlapping another.

Type parameters

A

The type of the annotations' values, specific to the application, such as a correction or a translation.

Value parameters

annotations

Its annotations.

text

The text annotated.

Attributes

Note

AnnotatedText.of makes one, checking that this holds.

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

Members list

Value members

Concrete methods

def ++[B >: A](other: AnnotatedText[B]): Either[List[Problem], AnnotatedText[B]]

It, with the annotations of other after its own, if it is of its text.

It, with the annotations of other after its own, if it is of its text.

Attributes

def annotate[B >: A](more: List[Annotation[B]]): Either[List[Problem], AnnotatedText[B]]

It, with more annotations after its own, if they fit its text.

It, with more annotations after its own, if they fit its text.

Attributes

def collect[B](pick: PartialFunction[A, B]): AnnotatedText[B]

It, with only the annotations whose values pick takes, as it takes them.

It, with only the annotations whose values pick takes, as it takes them.

Attributes

def filter(keep: A => Boolean): AnnotatedText[A]

It, with only the annotations whose values keep holds for.

It, with only the annotations whose values keep holds for.

Attributes

def map[B](transform: A => B): AnnotatedText[B]

It, with transform applied to each annotation's value.

It, with transform applied to each annotation's value.

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