Re: Proposal: add simpler case closure

Markus Scherer <[email protected]> Mon, 04 Oct 2004 15:29:02 -0700
Newsgroups gmane.comp.lib.icu.general
Organization IBM
Message-ID <[email protected]>
Deborah Goldsmith wrote:
> The simple case closure will take the existing items in the set, and 
> perform uppercase, lowercase, and titlecase (only relevant for strings) 
> operations on them, then add them back in. Therefore [a S DZ] would 
> become [a A s S DZ Dz dz].

Possible alternative:

You could add three options - one to add the simple-lowercase forms of the existing characters, one 
for upper, one for title. Then you would use only the upper+title for exemplar characters because we 
store them in lowercase.

This would get proper behavior, add some useful functionality, and would also help with performance 
because it would not have to look up the lowercase form of already-lowercase characters.

You could implement these three with one single loop.

Note: I recently munged the ICU4C case mapping code a lot, and modified UnicodeSet some, too. You 
will want to take a look at the new, internal ucase.h and use its functions, starting from 
ucase_getSingleton(). Makes it faster and more modular. Please keep such code in uniset_props.cpp, 
for modularization (uniset.cpp itself is now properties-free).

markus