Home | History | Annotate | Download | only in i18n

Lines Matching refs:ce32

45  * Build-time context and CE32 for a code point.
56 ce32(ce), defaultCE32(Collation::NO_CE32), builtCE32(Collation::NO_CE32),
63 * "\0" for the first entry for any code point, with its default CE32.
70 * CE32 for the code point and its context.
73 uint32_t ce32;
75 * Default CE32 for all contexts with this same prefix.
81 * CE32 for the built contexts.
115 * Some CE32 tags (for example, the DIGIT_TAG) do not occur in the builder data,
141 virtual uint32_t getCE32FromBuilderData(uint32_t ce32, UErrorCode &errorCode);
183 uint32_t ce32 = utrie2_get32(builder.trie, c);
185 if(ce32 == Collation::FALLBACK_CE32) {
187 ce32 = builder.base->getCE32(c);
191 appendCEsFromCE32(d, c, ce32, /*forward=*/ TRUE, errorCode);
253 DataBuilderCollationIterator::getCE32FromBuilderData(uint32_t ce32, UErrorCode &errorCode) {
254 U_ASSERT(Collation::hasCE32Tag(ce32, Collation::BUILDER_DATA_TAG));
255 if((ce32 & CollationDataBuilder::IS_BUILDER_JAMO_CE32) != 0) {
256 UChar32 jamo = Collation::indexFromCE32(ce32);
259 ConditionalCE32 *cond = builder.getConditionalCE32ForCE32(ce32);
284 // Reserve the first CE32 for U+0000.
393 CollationDataBuilder::getCE32FromOffsetCE32(UBool fromBase, UChar32 c, uint32_t ce32) const {
394 int32_t i = Collation::indexFromCE32(ce32);
412 uint32_t ce32 = utrie2_get32(trie, c);
413 if(Collation::isLongPrimaryCE32(ce32)) {
414 return Collation::primaryFromLongPrimaryCE32(ce32);
424 uint32_t ce32 = utrie2_get32(trie, c);
425 if(ce32 == Collation::FALLBACK_CE32) {
427 ce32 = base->getCE32(c);
429 while(Collation::isSpecialCE32(ce32)) {
430 switch(Collation::tagFromCE32(ce32)) {
444 return Collation::ceFromLongPrimaryCE32(ce32);
446 return Collation::ceFromLongSecondaryCE32(ce32);
448 if(Collation::lengthFromCE32(ce32) == 1) {
449 ce32);
450 ce32 = fromBase ? base->ce32s[i] : ce32s.elementAti(i);
457 if(Collation::lengthFromCE32(ce32) == 1) {
458 int32_t i = Collation::indexFromCE32(ce32);
466 // Fetch the non-numeric-collation CE32 and continue.
467 ce32 = ce32s.elementAti(Collation::indexFromCE32(ce32));
471 // Fetch the normal ce32 for U+0000 and continue.
472 ce32 = fromBase ? base->ce32s[0] : ce32s.elementAti(0);
475 ce32 = getCE32FromOffsetCE32(fromBase, c, ce32);
481 return Collation::ceFromSimpleCE32(ce32);
495 CollationDataBuilder::addCE32(uint32_t ce32, UErrorCode &errorCode) {
498 if(ce32 == (uint32_t)ce32s.elementAti(i)) { return i; }
500 ce32s.addElement((int32_t)ce32, errorCode);
505 CollationDataBuilder::addConditionalCE32(const UnicodeString &context, uint32_t ce32,
514 ConditionalCE32 *cond = new ConditionalCE32(context, ce32);
527 uint32_t ce32 = encodeCEs(ces, cesLength, errorCode);
528 addCE32(prefix, s, ce32, errorCode);
533 uint32_t ce32, UErrorCode &errorCode) {
562 utrie2_set32(trie, c, ce32, &errorCode);
566 cond->ce32 = ce32;
571 // Replace the simple oldCE32 with a builder context CE32
592 int32_t index = addConditionalCE32(context, ce32, errorCode);
601 int32_t index = addConditionalCE32(context, ce32, errorCode);
607 // Same context as before, overwrite its ce32.
608 nextCond->ce32 = ce32;
638 // Try to encode one CE as one CE32.
639 uint32_t ce32 = encodeOneCEAsCE32(ce);
640 if(ce32 != Collation::NO_CE32) { return ce32; }
669 // Try to encode two CEs as one CE32.
691 uint32_t ce32 = encodeOneCEAsCE32(ces[i]);
692 if(ce32 == Collation::NO_CE32) { break; }
693 newCE32s[i] = (int32_t)ce32;
766 CollationDataBuilder::copyFromBaseCE32(UChar32 c, uint32_t ce32, UBool withContext,
769 if(!Collation::isSpecialCE32(ce32)) { return ce32; }
770 switch(Collation::tagFromCE32(ce32)) {
777 const uint32_t *baseCE32s = base->ce32s + Collation::indexFromCE32(ce32);
778 int32_t length = Collation::lengthFromCE32(ce32);
779 ce32 = encodeExpansion32(
784 const int64_t *baseCEs = base->ces + Collation::indexFromCE32(ce32);
785 int32_t length = Collation::lengthFromCE32(ce32);
786 ce32 = encodeExpansion(baseCEs, length, errorCode);
792 const UChar *p = base->contexts + Collation::indexFromCE32(ce32);
793 ce32 = CollationData::readCE32(p); // Default if no prefix match.
795 return copyFromBaseCE32(c, ce32, FALSE, errorCode);
800 if(Collation::isContractionCE32(ce32)) {
801 index = copyContractionsFromBaseCE32(context, c, ce32, &head, errorCode);
803 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
804 head.next = index = addConditionalCE32(context, ce32, errorCode);
813 ce32 = (uint32_t)prefixes.getValue();
814 if(Collation::isContractionCE32(ce32)) {
815 index = copyContractionsFromBaseCE32(context, c, ce32, cond, errorCode);
817 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
818 cond->next = index = addConditionalCE32(context, ce32, errorCode);
823 ce32 = makeBuilderContextCE32(head.next);
829 const UChar *p = base->contexts + Collation::indexFromCE32(ce32);
830 ce32 = CollationData::readCE32(p); // Default if no suffix match.
831 return copyFromBaseCE32(c, ce32, FALSE, errorCode);
835 copyContractionsFromBaseCE32(context, c, ce32, &head, errorCode);
836 ce32 = makeBuilderContextCE32(head.next);
844 ce32 = getCE32FromOffsetCE32(TRUE, c, ce32);
847 ce32 = encodeOneCE(Collation::unassignedCEFromCodePoint(c), errorCode);
850 U_ASSERT(FALSE); // require ce32 == base->getFinalCE32(ce32)
853 return ce32;
857 CollationDataBuilder::copyContractionsFromBaseCE32(UnicodeString &context, UChar32 c, uint32_t ce32,
860 const UChar *p = base->contexts + Collation::indexFromCE32(ce32);
862 if((ce32 & Collation::CONTRACT_SINGLE_CP_NO_MATCH) != 0) {
869 ce32 = CollationData::readCE32(p); // Default if no suffix match.
870 U_ASSERT(!Collation::isContractionCE32(ce32));
871 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
872 cond->next = index = addConditionalCE32(context, ce32, errorCode);
881 ce32 = copyFromBaseCE32(c, (uint32_t)suffixes.getValue(), TRUE, errorCode);
882 cond->next = index = addConditionalCE32(context, ce32, errorCode);
900 UBool copyRangeCE32(UChar32 start, UChar32 end, uint32_t ce32) {
901 ce32 = copyCE32(ce32);
902 utrie2_setRange32(dest.trie, start, end, ce32, TRUE, &errorCode);
903 if(CollationDataBuilder::isBuilderContextCE32(ce32)) {
909 uint32_t copyCE32(uint32_t ce32) {
910 if(!Collation::isSpecialCE32(ce32)) {
911 int64_t ce = modifier.modifyCE32(ce32);
913 ce32 = dest.encodeOneCE(ce, errorCode);
916 int32_t tag = Collation::tagFromCE32(ce32);
919 srcCE32s += Collation::indexFromCE32(ce32);
920 int32_t length = Collation::lengthFromCE32(ce32);
925 ce32 = srcCE32s[i];
927 if(Collation::isSpecialCE32(ce32) ||
928 (ce = modifier.modifyCE32(ce32)) == Collation::NO_CE) {
930 modifiedCEs[i] = Collation::ceFromCE32(ce32);
943 ce32 = dest.encodeCEs(modifiedCEs, length, errorCode);
945 ce32 = dest.encodeExpansion32(
950 srcCEs += Collation::indexFromCE32(ce32);
951 int32_t length = Collation::lengthFromCE32(ce32);
973 ce32 = dest.encodeCEs(modifiedCEs, length, errorCode);
975 ce32 = dest.encodeExpansion(srcCEs, length, errorCode);
979 ConditionalCE32 *cond = src.getConditionalCE32ForCE32(ce32);
982 cond->context, copyCE32(cond->ce32), errorCode);
983 ce32 = CollationDataBuilder::makeBuilderContextCE32(destIndex);
988 cond->context, copyCE32(cond->ce32), errorCode);
1002 return ce32;
1046 uint32_t ce32 = utrie2_get32(trie, c);
1047 if(ce32 == Collation::FALLBACK_CE32) {
1048 ce32 = base->getFinalCE32(base->getCE32(c));
1049 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
1050 utrie2_set32(trie, c, ce32, &errorCode);
1062 uint32_t ce32 = utrie2_get32(trie, c);
1063 if(ce32 == Collation::FALLBACK_CE32) {
1064 ce32 = base->getFinalCE32(base->getCE32(c));
1065 if(Collation::ce32HasContext(ce32)) {
1066 ce32 = copyFromBaseCE32(c, ce32, FALSE /* without context */, errorCode);
1067 utrie2_set32(trie, c, ce32, &errorCode);
1069 } else if(isBuilderContextCE32(ce32)) {
1070 ce32 = getConditionalCE32ForCE32(ce32)->ce32;
1074 utrie2_set32(trie, c, ce32, &errorCode);
1089 uint32_t ce32 = utrie2_get32(trie, jamo);
1090 anyJamoAssigned |= Collation::isAssignedCE32(ce32);
1093 if(ce32 == Collation::FALLBACK_CE32) {
1095 ce32 = base->getCE32(jamo);
1097 if(Collation::isSpecialCE32(ce32)) {
1098 switch(Collation::tagFromCE32(ce32)) {
1102 // Copy the ce32 as-is.
1110 ce32 = Collation::FALLBACK_CE32;
1117 ce32 = Collation::FALLBACK_CE32;
1121 ce32 = getCE32FromOffsetCE32(fromBase, jamo, ce32);
1134 jamoCE32s[j] = ce32;
1156 uint32_t ce32 = utrie2_get32(trie, c);
1157 if(ce32 != Collation::FALLBACK_CE32 && ce32 != Collation::UNASSIGNED_CE32) {
1158 int32_t index = addCE32(ce32, errorCode);
1164 ce32 = Collation::makeCE32FromTagIndexAndLength(
1166 utrie2_set32(trie, c, ce32, &errorCode);
1236 // Small optimization: Use a bit in the Hangul ce32
1253 uint32_t ce32 = hangulCE32;
1255 ce32 |= Collation::HANGUL_NO_SPECIAL_JAMO;
1258 utrie2_setRange32(trie, c, limit - 1, ce32, TRUE, &errorCode);
1265 uint32_t ce32 = base->getCE32(c);
1266 U_ASSERT(Collation::hasCE32Tag(ce32, Collation::HANGUL_TAG));
1268 utrie2_setRange32(trie, c, limit - 1, ce32, TRUE, &errorCode);
1276 // For U+0000, move its normal ce32 into CE32s[0] and set U0000_TAG.
1317 uint32_t ce32 = utrie2_get32(trie, iter.getCodepoint());
1318 U_ASSERT(isBuilderContextCE32(ce32));
1319 getConditionalCE32ForCE32(ce32)->builtCE32 = Collation::NO_CE32;
1333 uint32_t ce32 = utrie2_get32(trie, c);
1334 if(!isBuilderContextCE32(ce32)) {
1339 ConditionalCE32 *cond = getConditionalCE32ForCE32(ce32);
1340 ce32 = buildContext(cond, errorCode);
1341 utrie2_set32(trie, c, ce32, &errorCode);
1366 uint32_t ce32;
1371 ce32 = lastCond->ce32;
1382 emptySuffixCE32 = firstCond->ce32;
1420 contractionBuilder.add(suffix, (int32_t)cond->ce32, errorCode);
1430 ce32 = Collation::makeCE32FromTagAndIndex(Collation::CONTRACTION_TAG, index) | flags;
1433 firstCond->defaultCE32 = ce32;
1437 return ce32;
1442 prefixBuilder.add(prefix, (int32_t)ce32, errorCode);