Package-level declarations

Types

Link copied to clipboard
data class Paragraph(val sentences: List<Sentence>, val sourceRange: IntRange)

A paragraph within a TextDocument, separated from other paragraphs by blank lines.

Link copied to clipboard
data class Punctuation(val text: String, val sourceRange: IntRange) : Token

One or more punctuation characters grouped together.

Link copied to clipboard
data class Sentence(val tokens: List<Token>, val terminator: Punctuation?, val sourceRange: IntRange)

A sentence within a Paragraph.

Link copied to clipboard
data class TextDocument(val paragraphs: List<Paragraph>)

Root AST node for a plain-text document.

Link copied to clipboard
sealed interface Token

A granular token within a Sentence.

Link copied to clipboard
data class Whitespace(val text: String, val sourceRange: IntRange) : Token

One or more whitespace characters (spaces, tabs).

Link copied to clipboard
data class Word(val text: String, val sourceRange: IntRange) : Token

A word — a contiguous run of letters and/or digits.