Parse Sentences

Splits a text into different sentences.

Command availability: IBM RPA SaaS and IBM RPA on premises

Description

Splits the text into individual sentences according to the defined language.

The results that this command returns might vary according to the selected NLP provider. For more information, see Setting an NLP provider.

Script syntax

IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.

parseSentences --culture(Culture) --text(String) (List<String>)=sentences (Boolean)=success

Input parameter

The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.

Designer mode label Script mode name Required Accepted variable types Description
Language culture Required Text, Culture The language that is used to analyze the input text.

If you define the language manually, make sure to enter only supported language codes.

See the culture parameter options for supported languages.
Text text Required Text Text to be analyzed.

culture parameter options

The following table displays the options available for the culture input parameter. The table shows the options available when working in Script mode and the equivalent label in the Designer mode.

Designer mode label Script mode name Description Supported provider
ar ar Arabic Watson NLP
zh-CN zh-CN Chinese (Simplified) Watson NLP
zh-TW zh-TW Chinese (Traditional) Watson NLP
cs cs Czech Watson NLP
da da Danish Watson NLP
nl nl Dutch Watson NLP
de-DE de-DE German Watson NLP
en-US en-US English Legacy and Watson NLP
fi fi Finnish Watson NLP
fr-FR fr-FR French (France) Watson NLP
fr-CA fr-CA French (Canada) Watson NLP
he he Hebrew Watson NLP
it-IT it-IT Italian Watson NLP
ja-JP ja-JP Japanese Watson NLP
ko-KR ko-KR Korean Watson NLP
nb nb Norwegian Bokmal Watson NLP
nn nn Norwegian Nynorsk Watson NLP
pt-BR pt-BR Portuguese (Brazil) Legacy and Watson NLP
pt-PT pt-PT Portuguese (Portugal) Legacy and Watson NLP
pl pl Polish Watson NLP
ro ro Romanian Watson NLP
ru-RU ru-RU Russian Watson NLP
sk sk Slovak Watson NLP
es-ES es-ES Spanish Watson NLP
sv sv Swedish Watson NLP
tr tr Turkish Watson NLP

Output parameter

Designer mode label Script mode name Accepted variable types Description
Parsed Sentences sentences List<Text> A list of all divided sentences.
Success success Boolean Returns True if the text was successfully split, otherwise returns False.

Example

The following example splits a single paragraph text into individual sentences.

defVar --name parsedSentence --type List --innertype String
defVar --name executionSuccess --type Boolean
defVar --name analyzedText --type String --value "Adapt the Robot without Programming Knowledge. Fast, Reliable and Secure. Automate Any Business Process. Reduce Costs and Increase Productivity. Increase Productivity. Process Automation. Data extraction. Reduce Costs by Up to 70%"
parseSentences --culture "en-US" --text "${analyzedText}" parsedSentence=sentences executionSuccess=success
logMessage --message "\r\nSentences obtained after division:\r\n${parsedSentence}\r\nSuccess: ${executionSuccess}" --type "Info"
// Return obtained after executing the script:
// Sentences obtained after division:
// [Adapt the Robot without Programming Knowledge.,Fast, Reliable and Secure.,Automate Any Business Process.,Reduce Costs and Increase Productivity.,Increase Productivity.,Process Automation.,Data extraction.,Reduce Costs by Up to 70%]
// Success: True
// Execution success: True