Parses a book file's bytes into the shared document model.
Both methods are Future-returning but do no I/O — the work is CPU-bound
from start to finish. Awaiting parse on a large book blocks the isolate
it runs on, so callers with a user interface should run it through
Isolate.run; everything inside the returned document is sendable as
long as any caller-supplied TextSegmenter holds plain data only.
Note that segmentation is not moved into the isolate by moving the parse into it: it is lazy, and runs on whichever isolate first touches ParagraphBlock.sentences. Images, in contrast, are eager and resident.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
Uint8List bytes, {required String fallbackLanguageCode, TextSegmenter? segmenter}) → Future< ParseResult< BookDocument> > -
Parses
bytesinto a full BookDocument. -
parseMetadata(
Uint8List bytes, {required String fallbackLanguageCode}) → Future< ParseResult< BookMetadata> > - Extracts only the BookMetadata — title, authors, language, cover.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited