Re: Proposal: add simpler case closure
Deborah Goldsmith <[email protected]> Mon, 4 Oct 2004 16:08:20 -0700
| Newsgroups | gmane.comp.lib.icu.general,gmane.comp.lib.icu.c++.support |
|---|---|
| Message-ID | <[email protected]> |
I like the idea, though it does add API complexity. I don't think exemplar sets are that performance-sensitive, but other applications of the new capability might well be. The constants would then be: USET_UPPERCASE_CLOSURE USET_LOWERCASE_CLOSURE USET_TITLECASE_CLOSURE I will have to do two implementations, as I need this work on 3.0 as well... Deborah On Oct 4, 2004, at 3:29 PM, Markus Scherer wrote: > 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 > _______________________________________________ > icu mailing list > [email protected] > http://oss.software.ibm.com/developerworks/oss/mailman/listinfo/icu