panbingkun commented on code in PR #46880:
URL: https://github.com/apache/spark/pull/46880#discussion_r1746589320
##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -11241,13 +11241,18 @@ def sentences(
) -> Column:
"""
Splits a string into arrays of sentences, where each sentence is an array
of words.
- The 'language' and 'country' arguments are optional, and if omitted, the
default locale is used.
+ The `language` and `country` arguments are optional,
+ if they are both omitted, the default locale (the language is 'en' and the
country is 'US')
+ is used, if the `country` is omitted, the default `country` ('') is used.
Review Comment:
I updated the comments like this:
```
* The `lang` and `country` arguments are optional, their default values are
all '',
* - When they are omitted:
* 1. If they are both omitted, the `locale(language='', country='')` is
used.
* 2. If the `country` is omitted, the `locale(language, country='')` is
used.
* - When they are null:
* 1. If they are both `null`, the `Locale.US - locale(language='en',
country='US')` is used.
* 2. If the `language` is null and the `country` is not null,
* the `Locale.US - locale(language='en', country='US')` is used.
* 3. If the `language` is not null and the `country` is null, the
`locale(language)` is used.
* 4. If neither is `null`, the `locale(language, country)` is used.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]