Segment

data class Segment(val locator: Locator, val text: String, val attributes: List<Content.Attribute<*>>) : Content.AttributesHolder

Ranged portion of text with associated attributes.

Parameters

locator

Locator to the segment of text.

text

Text in the segment.

attributes

Attributes associated with this segment, e.g. language.

Constructors

Link copied to clipboard
constructor(locator: Locator, text: String, attributes: List<Content.Attribute<*>>)

Properties

Link copied to clipboard
Link copied to clipboard
open override val attributes: List<Content.Attribute<*>>
Link copied to clipboard
open val language: Language?
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun <V> attribute(key: Content.AttributeKey<V>): V?

Gets the first attribute with the given key.

Link copied to clipboard
open fun <V> attributes(key: Content.AttributeKey<V>): List<V>

Gets all the attributes with the given key.