Zebra Translate
iOS API
API Reference for the Zebra iOS SDK (Cocoapod)
Zebra
Class for the Zebra Translate engine.
Resources should be cleaned when you are done using the delete() function.
Zebra.getAvailableDevices()
Retrieves a list of devices that can be specified when constructing Zebra.
Returns
- [String] : An array of available devices.
Throws
ZebraError: If an error occurs while retrieving the devices.
Zebra.init()
init method for Zebra Translate engine.
Parameters
accessKeyString : The AccessKey obtained from Picovoice Console.modelPathString? : Absolute path to file containing model parameters (.pv). Sets the source and target translation languages.deviceString? : String representation of the device (e.g., CPU or GPU) to use. If set tobest, the most suitable device is selected automatically. If set togpu, the engine uses the first available GPU device. To select a specific GPU device, set this argument togpu:${GPU_INDEX}, where${GPU_INDEX}is the index of the target GPU. If set tocpu, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this argument tocpu:${NUM_THREADS}, where${NUM_THREADS}is the desired number of threads.
Throws
ZebraError: If an error occurs while creating an instance of Zebra Translate engine.
Zebra.delete()
Releases resources acquired by the Zebra engine.
Zebra.translate()
Translates text. The maximum number of characters that can be translated at once
is given by .maxCharacterLimit.
Parameters
textString : Text to translate.
Returns
- String : Translated text.
Throws
ZebraError: If there is an error while translating.
Zebra.version
Current Zebra version.
Zebra.maxCharacterLimit
Maximum number of characters allowed in a single translation request.
ZebraError
Error thrown if an error occurs within Zebra Translate engine.