PredictionsCategoryBehavior
public protocol PredictionsCategoryBehavior
Behavior of the Predictions category that clients will use
-
Translate the text to the language specified.
Declaration
Swift
@discardableResult func convert(textToTranslate: String, language: LanguageType?, targetLanguage: LanguageType?, options: PredictionsTranslateTextRequest.Options?, 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
-
Synthesize the text to audio
Declaration
Swift
@discardableResult func convert(textToSpeech: String, options: PredictionsTextToSpeechRequest.Options?, 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
-
Transcribe audio to text
Declaration
Swift
@discardableResult 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 func identify(type: IdentifyAction, image: URL, options: PredictionsIdentifyRequest.Options?, 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 func interpret(text: String, options: PredictionsInterpretRequest.Options?, listener: PredictionsInterpretOperation.ResultListener?) -> PredictionsInterpretOperation
Parameters
text
Text to interpret
options
Parameters to specific plugin behavior
options
Parameters to specific plugin behavior
-
convert(textToTranslate:
Extension methodlanguage: targetLanguage: options: ) Translate the text to the language specified.
Declaration
Swift
func convert( textToTranslate: String, language: LanguageType? = nil, targetLanguage: LanguageType? = nil, options: PredictionsTranslateTextRequest.Options? = nil ) -> 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
-
convert(textToSpeech:
Extension methodoptions: ) Declaration
Swift
func convert( textToSpeech: String, options: PredictionsTextToSpeechRequest.Options? = nil ) -> PredictionsTextToSpeechOperation
Parameters
textToSpeech
The text to be synthesized to audio
options
Parameters to specific plugin behavior
-
convert(speechToText:
Extension methodoptions: ) Declaration
Swift
func convert( speechToText: URL, options: PredictionsSpeechToTextRequest.Options? = nil ) -> PredictionsSpeechToTextOperation
Parameters
speechToText
The url of the audio to be transcribed
options
Parameters to specific plugin behavior
-
identify(type:
Extension methodimage: options: ) Translate the text to the language specified.
Declaration
Swift
func identify( type: IdentifyAction, image: URL, options: PredictionsIdentifyRequest.Options? = nil ) -> PredictionsIdentifyOperation
Parameters
type
The type of image detection you want to perform
image
The image you are sending
options
Parameters to specific plugin behavior
-
interpret(text:
Extension methodoptions: ) Interpret the text and return sentiment analysis, entity detection, language detection, syntax detection, key phrases detection
Declaration
Swift
func interpret( text: String, options: PredictionsInterpretRequest.Options? = nil ) -> PredictionsInterpretOperation
Parameters
text
Text to interpret
options
Parameters to specific plugin behavior
options
Parameters to specific plugin behavior