sentences 函数

适用于:check marked yes Databricks SQL check marked yes Databricks Runtime

str 拆分为一个数组,其中包含单词数组。

语法

sentences(str [, lang, country] )

参数

  • str:要分析的 STRING 表达式。
  • lang:一个可选 STRING 表达式,包含 ISO 639 Alpha-2 的语言代码(例如“DE”)、Alpha-3 或最多 8 个字符的语言子标记。
  • country:可选 STRING 表达式,其中包含来自 ISO 3166 alpha-2 国家/地区代码的国家/地区代码或 3 位数字的 UN M.49 区号。

返回

STRING 组成的 ARRAY 组成的 ARRAY

lang 和 country 的默认值分别为 enUS

示例

> SELECT sentences('Hi there! Good morning.');
 [[Hi, there],[Good, morning]]
> SELECT sentences('Hi there! Good morning.', 'en', 'US');
 [[Hi, there],[Good, morning]]