Lines Matching full:ce32
43 * Build-time context and CE32 for a code point.
54 ce32(0), defaultCE32(Collation::NO_CE32), builtCE32(Collation::NO_CE32),
58 ce32(ce), defaultCE32(Collation::NO_CE32), builtCE32(Collation::NO_CE32),
65 * "\0" for the first entry for any code point, with its default CE32.
72 * CE32 for the code point and its context.
75 uint32_t ce32;
77 * Default CE32 for all contexts with this same prefix.
83 * CE32 for the built contexts.
117 * Some CE32 tags (for example, the DIGIT_TAG) do not occur in the builder data,
143 virtual uint32_t getCE32FromBuilderData(uint32_t ce32, UErrorCode &errorCode);
185 uint32_t ce32 = utrie2_get32(builder.trie, c);
187 if(ce32 == Collation::FALLBACK_CE32) {
189 ce32 = builder.base->getCE32(c);
193 appendCEsFromCE32(d, c, ce32, /*forward=*/ TRUE, errorCode);
255 DataBuilderCollationIterator::getCE32FromBuilderData(uint32_t ce32, UErrorCode &errorCode) {
256 U_ASSERT(Collation::hasCE32Tag(ce32, Collation::BUILDER_DATA_TAG));
257 if((ce32 & CollationDataBuilder::IS_BUILDER_JAMO_CE32) != 0) {
258 UChar32 jamo = Collation::indexFromCE32(ce32);
261 ConditionalCE32 *cond = builder.getConditionalCE32ForCE32(ce32);
286 // Reserve the first CE32 for U+0000.
395 CollationDataBuilder::getCE32FromOffsetCE32(UBool fromBase, UChar32 c, uint32_t ce32) const {
396 int32_t i = Collation::indexFromCE32(ce32);
414 uint32_t ce32 = utrie2_get32(trie, c);
415 if(Collation::isLongPrimaryCE32(ce32)) {
416 return Collation::primaryFromLongPrimaryCE32(ce32);
427 uint32_t ce32 = utrie2_get32(trie, c);
428 if(ce32 == Collation::FALLBACK_CE32) {
430 ce32 = base->getCE32(c);
432 while(Collation::isSpecialCE32(ce32)) {
433 switch(Collation::tagFromCE32(ce32)) {
447 return Collation::ceFromLongPrimaryCE32(ce32);
449 ce32);
451 if(Collation::lengthFromCE32(ce32) == 1) {
452 int32_t i = Collation::indexFromCE32(ce32);
453 ce32 = fromBase ? base->ce32s[i] : ce32s.elementAti(i);
460 if(Collation::lengthFromCE32(ce32) == 1) {
461 int32_t i = Collation::indexFromCE32(ce32);
469 // Fetch the non-numeric-collation CE32 and continue.
470 ce32 = ce32s.elementAti(Collation::indexFromCE32(ce32));
474 // Fetch the normal ce32 for U+0000 and continue.
475 ce32 = fromBase ? base->ce32s[0] : ce32s.elementAti(0);
478 ce32 = getCE32FromOffsetCE32(fromBase, c, ce32);
484 return Collation::ceFromSimpleCE32(ce32);
498 CollationDataBuilder::addCE32(uint32_t ce32, UErrorCode &errorCode) {
501 if(ce32 == (uint32_t)ce32s.elementAti(i)) { return i; }
503 ce32s.addElement((int32_t)ce32, errorCode);
508 CollationDataBuilder::addConditionalCE32(const UnicodeString &context, uint32_t ce32,
517 ConditionalCE32 *cond = new ConditionalCE32(context, ce32);
530 uint32_t ce32 = encodeCEs(ces, cesLength, errorCode);
531 addCE32(prefix, s, ce32, errorCode);
536 uint32_t ce32, UErrorCode &errorCode) {
565 utrie2_set32(trie, c, ce32, &errorCode);
569 cond->ce32 = ce32;
574 // Replace the simple oldCE32 with a builder context CE32
595 int32_t index = addConditionalCE32(context, ce32, errorCode);
604 int32_t index = addConditionalCE32(context, ce32, errorCode);
610 // Same context as before, overwrite its ce32.
611 nextCond->ce32 = ce32;
641 // Try to encode one CE as one CE32.
642 uint32_t ce32 = encodeOneCEAsCE32(ce);
643 if(ce32 != Collation::NO_CE32) { return ce32; }
672 // Try to encode two CEs as one CE32.
694 uint32_t ce32 = encodeOneCEAsCE32(ces[i]);
695 if(ce32 == Collation::NO_CE32) { break; }
696 newCE32s[i] = (int32_t)ce32;
769 CollationDataBuilder::copyFromBaseCE32(UChar32 c, uint32_t ce32, UBool withContext,
772 if(!Collation::isSpecialCE32(ce32)) { return ce32; }
773 switch(Collation::tagFromCE32(ce32)) {
780 const uint32_t *baseCE32s = base->ce32s + Collation::indexFromCE32(ce32);
781 int32_t length = Collation::lengthFromCE32(ce32);
782 ce32 = encodeExpansion32(
787 const int64_t *baseCEs = base->ces + Collation::indexFromCE32(ce32);
788 int32_t length = Collation::lengthFromCE32(ce32);
789 ce32 = encodeExpansion(baseCEs, length, errorCode);
795 const UChar *p = base->contexts + Collation::indexFromCE32(ce32);
796 ce32 = CollationData::readCE32(p); // Default if no prefix match.
798 return copyFromBaseCE32(c, ce32, FALSE, errorCode);
803 if(Collation::isContractionCE32(ce32)) {
804 index = copyContractionsFromBaseCE32(context, c, ce32, &head, errorCode);
806 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
807 head.next = index = addConditionalCE32(context, ce32, errorCode);
816 ce32 = (uint32_t)prefixes.getValue();
817 if(Collation::isContractionCE32(ce32)) {
818 index = copyContractionsFromBaseCE32(context, c, ce32, cond, errorCode);
820 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
821 cond->next = index = addConditionalCE32(context, ce32, errorCode);
826 ce32 = makeBuilderContextCE32(head.next);
832 const UChar *p = base->contexts + Collation::indexFromCE32(ce32);
833 ce32 = CollationData::readCE32(p); // Default if no suffix match.
834 return copyFromBaseCE32(c, ce32, FALSE, errorCode);
838 copyContractionsFromBaseCE32(context, c, ce32, &head, errorCode);
839 ce32 = makeBuilderContextCE32(head.next);
847 ce32 = getCE32FromOffsetCE32(TRUE, c, ce32);
850 ce32 = encodeOneCE(Collation::unassignedCEFromCodePoint(c), errorCode);
853 U_ASSERT(FALSE); // require ce32 == base->getFinalCE32(ce32)
856 return ce32;
860 CollationDataBuilder::copyContractionsFromBaseCE32(UnicodeString &context, UChar32 c, uint32_t ce32,
863 const UChar *p = base->contexts + Collation::indexFromCE32(ce32);
865 if((ce32 & Collation::CONTRACT_SINGLE_CP_NO_MATCH) != 0) {
872 ce32
873 U_ASSERT(!Collation::isContractionCE32(ce32));
874 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
875 cond->next = index = addConditionalCE32(context, ce32, errorCode);
884 ce32 = copyFromBaseCE32(c, (uint32_t)suffixes.getValue(), TRUE, errorCode);
885 cond->next = index = addConditionalCE32(context, ce32, errorCode);
903 UBool copyRangeCE32(UChar32 start, UChar32 end, uint32_t ce32) {
904 ce32 = copyCE32(ce32);
905 utrie2_setRange32(dest.trie, start, end, ce32, TRUE, &errorCode);
906 if(CollationDataBuilder::isBuilderContextCE32(ce32)) {
912 uint32_t copyCE32(uint32_t ce32) {
913 if(!Collation::isSpecialCE32(ce32)) {
914 int64_t ce = modifier.modifyCE32(ce32);
916 ce32 = dest.encodeOneCE(ce, errorCode);
919 int32_t tag = Collation::tagFromCE32(ce32);
922 srcCE32s += Collation::indexFromCE32(ce32);
923 int32_t length = Collation::lengthFromCE32(ce32);
928 ce32 = srcCE32s[i];
930 if(Collation::isSpecialCE32(ce32) ||
931 (ce = modifier.modifyCE32(ce32)) == Collation::NO_CE) {
933 modifiedCEs[i] = Collation::ceFromCE32(ce32);
946 ce32 = dest.encodeCEs(modifiedCEs, length, errorCode);
948 ce32 = dest.encodeExpansion32(
953 srcCEs += Collation::indexFromCE32(ce32);
954 int32_t length = Collation::lengthFromCE32(ce32);
976 ce32 = dest.encodeCEs(modifiedCEs, length, errorCode);
978 ce32 = dest.encodeExpansion(srcCEs, length, errorCode);
982 ConditionalCE32 *cond = src.getConditionalCE32ForCE32(ce32);
985 cond->context, copyCE32(cond->ce32), errorCode);
986 ce32 = CollationDataBuilder::makeBuilderContextCE32(destIndex);
991 cond->context, copyCE32(cond->ce32), errorCode);
1005 return ce32;
1049 uint32_t ce32 = utrie2_get32(trie, c);
1050 if(ce32 == Collation::FALLBACK_CE32) {
1051 ce32 = base->getFinalCE32(base->getCE32(c));
1052 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
1053 utrie2_set32(trie, c, ce32, &errorCode);
1065 uint32_t ce32 = utrie2_get32(trie, c);
1066 if(ce32 == Collation::FALLBACK_CE32) {
1067 ce32 = base->getFinalCE32(base->getCE32(c));
1068 if(Collation::ce32HasContext(ce32)) {
1069 ce32 = copyFromBaseCE32(c, ce32, FALSE /* without context */, errorCode);
1070 utrie2_set32(trie, c, ce32, &errorCode);
1072 } else if(isBuilderContextCE32(ce32)) {
1073 ce32 = getConditionalCE32ForCE32(ce32)->ce32;
1077 utrie2_set32(trie, c, ce32, &errorCode);
1092 uint32_t ce32 = utrie2_get32(trie, jamo);
1093 anyJamoAssigned |= Collation::isAssignedCE32(ce32);
1096 if(ce32 == Collation::FALLBACK_CE32) {
1098 ce32 = base->getCE32(jamo);
1100 if(Collation::isSpecialCE32(ce32)) {
1101 switch(Collation::tagFromCE32(ce32)) {
1105 // Copy the ce32 as-is.
1113 ce32 = Collation::FALLBACK_CE32;
1120 ce32 = Collation::FALLBACK_CE32;
1124 ce32 = getCE32FromOffsetCE32(fromBase, jamo, ce32);
1137 jamoCE32s[j] = ce32;
1159 uint32_t ce32 = utrie2_get32(trie, c);
1160 if(ce32 != Collation::FALLBACK_CE32 && ce32 != Collation::UNASSIGNED_CE32) {
1161 int32_t index = addCE32(ce32, errorCode);
1167 ce32 = Collation::makeCE32FromTagIndexAndLength(
1169 utrie2_set32(trie, c, ce32, &errorCode);
1241 // Small optimization: Use a bit in the Hangul ce32
1258 uint32_t ce32 = hangulCE32;
1260 ce32 |= Collation::HANGUL_NO_SPECIAL_JAMO;
1263 ce32, TRUE, &errorCode);
1270 uint32_t ce32 = base->getCE32(c);
1271 U_ASSERT(Collation::hasCE32Tag(ce32, Collation::HANGUL_TAG));
1273 utrie2_setRange32(trie, c, limit - 1, ce32, TRUE, &errorCode);
1281 // For U+0000, move its normal ce32 into CE32s[0] and set U0000_TAG.
1322 uint32_t ce32 = utrie2_get32(trie, iter.getCodepoint());
1323 U_ASSERT(isBuilderContextCE32(ce32));
1324 getConditionalCE32ForCE32(ce32)->builtCE32 = Collation::NO_CE32;
1338 uint32_t ce32 = utrie2_get32(trie, c);
1339 if(!isBuilderContextCE32(ce32)) {
1344 ConditionalCE32 *cond = getConditionalCE32ForCE32(ce32);
1345 ce32 = buildContext(cond, errorCode);
1346 utrie2_set32(trie, c, ce32, &errorCode);
1371 uint32_t ce32;
1376 ce32 = lastCond->ce32;
1387 emptySuffixCE32 = firstCond->ce32;
1425 contractionBuilder.add(suffix, (int32_t)cond->ce32, errorCode);
1435 ce32 = Collation::makeCE32FromTagAndIndex(Collation::CONTRACTION_TAG, index) | flags;
1438 firstCond->defaultCE32 = ce32;
1442 return ce32;
1447 prefixBuilder.add(prefix, (int32_t)ce32, errorCode);