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

STLR: using singular term for predefined characters #11

Closed
markmunz opened this issue Dec 1, 2017 · 1 comment · Fixed by #58
Closed

STLR: using singular term for predefined characters #11

markmunz opened this issue Dec 1, 2017 · 1 comment · Fixed by #58
Assignees

Comments

@markmunz
Copy link

markmunz commented Dec 1, 2017

Use singular for predefined sets (.decimalDigit, .letter vs. .decimalDigits, .letters)

ICU specifies character categories in singular terms (\p{Decimal}, \p{Letter}) with the quantifier being separate (+, *, ?, {n,m})

SLTR rule also uses modifiers (?,*,+) to specify quantity and seems more in line with a Regular Expression type of declaration. Plural term in the definition seems to imply multiple of given category, when it's only one of N. When you read the STLR

number = .decimalDigits

One could infer it to match the number "123" when in fact it will only match the "1"

Examples of the singular w/ modifiers:

digits = .decimalDigit+ // one or more of a decimal digit
ows = .whitespace? // optional whitespace char

@SwiftStudies
Copy link
Owner

Thanks for raising this. I've been thinking about it over the weekend and last few days and my feeling is that I wish to remain consistent with Swift foundation at this time. One of the reasons for this decision is actually the other request for a .backslash which would actually be a single character terminal where the singular now makes sense, and consequently the plural is communicating something.

@SwiftStudies SwiftStudies self-assigned this Dec 7, 2017
@SwiftStudies SwiftStudies reopened this Mar 1, 2018
SwiftStudies added a commit that referenced this issue Mar 1, 2018
Fixes #55 and fixes #11

I changed my mind! Updated plurality, and documentation. This is a source breaking change...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants