Share via


sentences 函式

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

分割 str 成單字陣列。

語法

sentences(str [, lang, country] )

引數

  • strSTRING:要剖析的運算式。
  • lang:具有語言代碼的 ISO 639 Alpha-2 選擇性 STRING 運算式(例如 'DE'), Alpha-3 或最多 8 個字元的語言子標記。
  • country:具有國家/地區代碼或數值 3 區功能變數代碼之國家/地區代碼 ISO 3166 alpha-2UN M.49 選擇性 STRING 運算式。

傳回

ARRAYARRAYSTRING

lang 的預設值為 en 和 國家/地區 US

範例

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