TextProofreader
class TextProofreader : NSObjectPerforms proofreading on text using a LiteRT-LM model asset bundle.
-
Creates a new instance of
TextProofreaderfrom an absolute path to a model asset bundle.Declaration
Swift
convenience init(modelPath: String) throwsParameters
modelPathAbsolute path to a model file on the device.
Return Value
A new instance of
TextProofreader. -
Creates a new instance of
TextProofreaderfrom the givenTextProofreaderOptions.Declaration
Swift
init(options: TextProofreaderOptions) throwsParameters
optionsThe TextProofreaderOptions used to configure the proofreader.
Return Value
A new instance of
TextProofreader. -
Performs proofreading on the input text.
Declaration
Swift
func proofread(text: String) throws -> TextProofreaderResultParameters
textThe String on which proofreading is to be performed.
Return Value
A
TextProofreaderResultcontaining the proofread text and corrections. -
Performs proofreading on the input text and delivers incremental results via the completion handler.
Declaration
Swift
func proofreadStreaming(text: String, completion: @escaping (TextProofreaderResult?, Error?) -> Void) throwsParameters
textThe input text to proofread.
completionCallback invoked with incremental proofreading results.
-
Shuts down the
TextProofreaderwhen all work is done.Declaration
Swift
func close() throws