sentences
function
Applies to: Databricks SQL Databricks Runtime
Splits str
into an array of array of words.
Syntax
sentences(str [, lang, country] )
Arguments
str
: ASTRING
expression to be parsed.lang
: An optionalSTRING
expression with a language code fromISO 639 Alpha-2
(e.g. ‘DE’),Alpha-3
, or a language subtag of up to 8 characters.country
: An optionalSTRING
expression with a country code fromISO 3166 alpha-2
country code or aUN M.49
numeric-3 area code.
Returns
An ARRAY
of ARRAY
of STRING
.
The default for lang is en
and country US
.
Examples
> SELECT sentences('Hi there! Good morning.');
[[Hi, there],[Good, morning]]
> SELECT sentences('Hi there! Good morning.', 'en', 'US');
[[Hi, there],[Good, morning]]