PredictionsCategory
final public class PredictionsCategory : Category
extension PredictionsCategory: Resettable
extension PredictionsCategory: PredictionsCategoryBehavior
-
Declaration
Swift
public let categoryType: CategoryType
-
Adds
plugin
to the list of Plugins that implement functionality for this category.Declaration
Swift
public func add(plugin: PredictionsCategoryPlugin) throws
Parameters
plugin
The Plugin to add
-
Returns the added plugin with the specified
key
property.Declaration
Swift
public func getPlugin(for key: PluginKey) throws -> PredictionsCategoryPlugin
Parameters
key
The PluginKey (String) of the plugin to retrieve
Return Value
The wrapped plugin
-
Removes the plugin registered for
key
from the list of Plugins that implement functionality for this category. If no plugin has been added forkey
, no action is taken, making this method safe to call multiple times.Declaration
Swift
public func removePlugin(for key: PluginKey)
Parameters
key
The key used to
add
the plugin -
Declaration
Swift
public func reset(onComplete: @escaping (() -> Void))
-
Synthesize the text to audio
Declaration
Swift
@discardableResult public func convert(textToSpeech: String, options: PredictionsTextToSpeechRequest.Options? = nil, listener: PredictionsTextToSpeechOperation.ResultListener? ) -> PredictionsTextToSpeechOperation
Parameters
textToSpeech
The text to be synthesized to audio
listener
Triggered when the event occurs
options
Parameters to specific plugin behavior
-
Translate the text to the language specified.
Declaration
Swift
@discardableResult public func convert(textToTranslate: String, language: LanguageType?, targetLanguage: LanguageType?, options: PredictionsTranslateTextRequest.Options? = nil, listener: PredictionsTranslateTextOperation.ResultListener? ) -> PredictionsTranslateTextOperation
Parameters
textToTranslate
The text to translate
language
The language of the text given
targetLanguage
The language to which the text should be translated
options
Parameters to specific plugin behavior
listener
Triggered when the event occurs
-
Transcribe audio to text
Declaration
Swift
@discardableResult public func convert(speechToText: URL, options: PredictionsSpeechToTextRequest.Options?, listener: PredictionsSpeechToTextOperation.ResultListener? ) -> PredictionsSpeechToTextOperation
Parameters
speechToText
The url of the audio to be transcribed
listener
Triggered when the event occurs
options
Parameters to specific plugin behavior
-
Detect contents of an image based on
IdentifyAction
Declaration
Swift
@discardableResult public func identify(type: IdentifyAction, image: URL, options: PredictionsIdentifyRequest.Options? = nil, listener: PredictionsIdentifyOperation.ResultListener? ) -> PredictionsIdentifyOperation
Parameters
type
The type of image detection you want to perform
image
The image you are sending
options
Parameters to specific plugin behavior
listener
Triggered when the event occurs
-
Interpret the text and return sentiment analysis, entity detection, language detection, syntax detection, key phrases detection
Declaration
Swift
@discardableResult public func interpret(text: String, options: PredictionsInterpretRequest.Options? = nil, listener: PredictionsInterpretOperation.ResultListener? ) -> PredictionsInterpretOperation
Parameters
text
Text to interpret
options
Parameters to specific plugin behavior
options
Parameters to specific plugin behavior