UDPipeService class

Singleton service that wraps the UDPipe native library via dart:ffi.

Usage:

final svc = UDPipeService();
await svc.init(modelId: 'gsd');
final result = svc.process('Er steigt aus dem Bus aus.');

Constructors

UDPipeService()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isAvailable bool
Whether a model is loaded and process can be called.
no setter
loadError String?
Human-readable error message when status is UDPipeStatus.error.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status ValueNotifier<UDPipeStatus>
Current loading state. Listen to this notifier to react to state changes.
final
whenReady Future<void>
Completes when the current init call finishes (or immediately if idle).
no setter

Methods

dispose() → void
Frees the native model handle. Call before loading a different model.
init({String modelId = 'hdt'}) Future<void>
Loads the model identified by modelId (one of kUdpipeModels). Returns immediately if the requested model is already loaded.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
process(String text) UDPipeResult
Runs UDPipe on text and returns the parsed result.
processAllBlocksAsync(List<String> blocks) Future<List<UDPipeResult>>
Processes blocks in a background isolate, yielding one UDPipeResult per block. Keeps the UI thread free for large inputs.
processBatchPerBlock(List<String> blocks) List<UDPipeResult>
Processes blocks synchronously, returning one UDPipeResult per block.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited