The i18n group said we’d figure out collator options by email.  This is an 
email ☺

The strawman used the “strength” term for collation options, however there 
seemed to be a general feeling that descriptive flags would be more useful.  So 
here’s an attempt at some flags.  These “I” can do fairly easily on Windows, 
but I don’t know how they’d work in ICU.


·         Ordinal – (code point based non-linguistic comparison.  This sort of 
defeats the purpose of passing in a locale, however it is a very common 
scenario for some people.  Eg: I don’t want to compare passwords in a 
linguistic fashion.)  This should basically be mutually exclusive with any 
other option.

·         IgnoreCase – Ignore case for case sensitive scripts.  Hopefully don’t 
ignore anything else, but some frameworks may have trouble with that

·         IgnoreDiacritics – Ignore diacritics/nonspacing characters.

·         IgnoreKanaType – Treat Hiragana and Katakana the same.

·         IgnoreWidth – Treat CJK full and halfwidth characters the same.

·         SortDigitsAsNumbers – Eg: 12 comes before 101.

Are these all “doable” for other frameworks? (ICU?)

Assuming that we go with the “no options == default options for the locale” 
model, then I’m a bit confused how we set these.  Seems like there are a few 
possibilities:


A)     { ignoreCase: true } (etc) – the problem is that if you wanted explicit 
behavior (overriding the defaults), you’d have to specify everything?  Or 
specifying any one thing would get rid of all the default behavior (so you only 
had what you explicitly requested), which might make it hard to get some 
specific behavior along with default behavior?  Maybe a decent way would be:

(Assuming that setting any of the “flag” options causes all of the locale 
compare flag defaults to then be false)

a.       To change some locale to be case sensitive and ignore width, 
maintaining the other behavior

var c1 = new Collator( en );

var options = c1.options;

options.ignoreCase = false;

options.ignoreWidth = true;

var c2 = new Collator(options);

b.      To explicitly set case sensitive and ignore width, losing any other 
default behavior of the locale:

var c1 = new Collator( { localeInfo: en, ignoreCase: false, ignoreWidth: true );

(We’d ignore whatever the defaults were for en, making the ignoreCase:false 
redundant.  If any other flags (kana, etc) had defaults for the locale, then 
they’d be lost (false)).



B)      { flags: IgnoreCase | IgnoreWidth } (etc, someone can fix the syntax 
for me ☺)  -- Specify only the flags that you want to use.  You wouldn’t have 
to specify everything?

Thoughts?  Suggestions?

- Shawn

 
http://blogs.msdn.com/shawnste

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to