Annotation

com.alecdorrington.annotatedtextformat.Annotation
See theAnnotation companion object
final case class Annotation[+A](spans: List[TextSpan], value: A)

A value attached to spans of a text: one, as a word, or several, as the parts of a separable verb, or a span of words and the point to which they move. In an annotated text, it has at least one span, its spans are in order, and none overlaps another.

Type parameters

A

The type of the value, specific to the application, such as a correction or a translation.

Value parameters

spans

The spans to which the value is attached, in order, none overlapping another.

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

def extent: Option[TextSpan]

The span from where its first span begins to where its last ends, unless it has none, as no annotation of an AnnotatedText does.

The span from where its first span begins to where its last ends, unless it has none, as no annotation of an AnnotatedText does.

Attributes

def in(text: String): List[String]

Its parts of text, one for each of its spans.

Its parts of text, one for each of its spans.

Attributes

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

It, with transform applied to its value.

It, with transform applied to its value.

Attributes

def overlaps(other: Annotation[_]): Boolean

Whether any of its spans shares a character with any of other's.

Whether any of its spans shares a character with any of other's.

Attributes

def points: List[TextSpan]

Its spans that are points.

Its spans that are points.

Attributes

def stretches: List[TextSpan]

Its spans that are not points.

Its spans that are not points.

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