Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Added support for sentence break suppressions to Intl.Segmenter #783

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ben-allen
Copy link
Collaborator

fix #580

Added support for u-ss to Intl.Segmenter

@ben-allen ben-allen requested review from ryzokuken and srl295 and removed request for srl295 May 11, 2023 21:31
Copy link
Member

@srl295 srl295 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines -79 to -81
<emu-note>
Intl.Segmenter does not have any relevant extension keys.
</emu-note>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lb and lw are only for line break, which Intl.Segmenter doesn't support.

dx is not widely used or implemented, and I've raised questions about its utility.

@ben-allen ben-allen marked this pull request as ready for review May 11, 2023 22:49
spec/segmenter.html Outdated Show resolved Hide resolved
Co-authored-by: Shane F. Carr <shane@unicode.org>
Copy link
Member

@ryzokuken ryzokuken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spec changes LGTM, none of the three mentioned extension keys are supported in Intl yet and we shouldn't introduce more than one in a single PR so it looks good to go from my end. Let's see how people feel about this.

@sffc
Copy link
Contributor

sffc commented Jun 2, 2023

@FrankYFTang
Copy link
Contributor

Sorry, I think we need additional changes that I forget to mention in TG2.

A. We should also change
14.1.1 Intl.Locale ( tag [ , options ] )
https://tc39.es/ecma402/#sec-Intl.Locale
to take option
"sentenceBreakSuppressions"

B. The internal slot of Locale should also include "ss"
https://tc39.es/ecma402/#sec-intl.locale-internal-slots

C. We should also add a getter in section 14.3
https://tc39.es/ecma402/#sec-properties-of-intl-locale-prototype-object
14.3.X get Intl.Locale.prototype.sentenceBreakSuppressions

which return either "none" (default) or "standard")

@ben-allen ben-allen force-pushed the sentence-break-suppressions branch 2 times, most recently from 9a97754 to a873ee4 Compare June 9, 2023 19:27
@ben-allen ben-allen force-pushed the sentence-break-suppressions branch from a873ee4 to 4e83568 Compare June 9, 2023 19:31
@ben-allen
Copy link
Collaborator Author

Updated to incorporate required changes to Intl.Locale & include a note in Annex A. Unclear on needed changes to Annex B.

@@ -52,6 +52,8 @@ <h1>Intl.Locale ( _tag_ [ , _options_ ] )</h1>
1. If _numberingSystem_ is not *undefined*, then
1. If _numberingSystem_ does not match the Unicode Locale Identifier `type` nonterminal, throw a *RangeError* exception.
1. Set _opt_.[[nu]] to _numberingSystem_.
1. Let _sentenceBreakSuppressions_ be ? GetOption(_options_, *"sentenceBreakSuppressions"*, ~string~, &laquo;*"none"*, *"standard"* &raquo;, *"none"*).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Intl.Locale constructor, the default value for "sentenceBreakSuppressions" should be undefined. (Comparing to other options, such as "calendar", "collation", "hourCycle", "caseFirst", "numeric", "numberingSystem")

@ryzokuken ryzokuken added the has consensus Has consensus from TC39-TG2 label Jun 29, 2023
@sffc
Copy link
Contributor

sffc commented Aug 23, 2023

Note: @dminor would like to wait until ICU4X supports this feature before merging this PR.

unicode-org/icu4x#3927

@sffc sffc added the s: blocked Status: the issue is blocked on upstream label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has consensus Has consensus from TC39-TG2 normative s: blocked Status: the issue is blocked on upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for more subtags
5 participants