TextDocument constructor
TextDocument({})
Hydrates a const TextDocument from the document properties.
sourceText
is all the analysed text in the document. The text from a JSON document's (analysed) fields is joined with line ending marks;paragraphs
is a list of strings after splittingsourceText
at line ending marks;sentences
is a list of strings after splittingsourceText
at sentence ending punctuation and line ending marks;nGrams
is a collection of word sequences generated from the terms;terms
is all the words in thesourceText
;keywords
is the keywords in the document mapped to their RAKE keyword score in a TermCoOccurrenceGraph;syllableCount
is the total number of syllables in the document; andtokens
is all the tokens extracted fromsourceText
.
Implementation
factory TextDocument(
{required String sourceText,
required List<Token> tokens,
required List<String> paragraphs,
required List<String> sentences,
required List<String> terms,
required List<String> nGrams,
required TermCoOccurrenceGraph keywords,
required int syllableCount,
List<String>? zones}) =>
_TextDocumentImpl(sourceText, zones, tokens, paragraphs, sentences, terms,
nGrams, syllableCount, keywords);