Lines Matching defs:norm
98 struct Norm {
177 normMem=utm_open("gennorm2 normalization structs", 10000, 0x110100, sizeof(Norm));
178 norms=allocNorm(); // unused Norm struct at index 0
212 Norm *Normalizer2DataBuilder::allocNorm() {
213 Norm *p=(Norm *)utm_alloc(normMem);
214 norms=(Norm *)utm_getStart(normMem); // in case it got reallocated
218 /* get an existing Norm unit */
219 Norm *Normalizer2DataBuilder::getNorm(UChar32 c) {
227 const Norm &Normalizer2DataBuilder::getNormRef(UChar32 c) const {
232 * get or create a Norm unit;
235 Norm *Normalizer2DataBuilder::createNorm(UChar32 c) {
240 /* allocate Norm */
241 Norm *p=allocNorm();
248 Norm *Normalizer2DataBuilder::checkNormForMapping(Norm *p, UChar32 c) {
250 if(p->mappingType!=Norm::NONE) {
295 Norm *p=checkNormForMapping(createNorm(c), c);
297 p->mappingType=Norm::ONE_WAY;
324 Norm *p=checkNormForMapping(createNorm(c), c);
326 p->mappingType=Norm::ROUND_TRIP;
331 Norm *p=checkNormForMapping(getNorm(c), c);
333 p->mappingType=Norm::REMOVED;
348 if(norms[value].mappingType==Norm::ROUND_TRIP) {
380 Norm *leadNorm=createNorm(lead);
408 UBool Normalizer2DataBuilder::combinesWithCCBetween(const Norm &norm,
412 const CompositionPair *pairs=norm.getCompositionPairs(length);
423 UChar32 Normalizer2DataBuilder::combine(const Norm &norm, UChar32 trail) const {
425 const CompositionPair *pairs=norm.getCompositionPairs(length);
450 Norm &norm=norms[value];
451 const UnicodeString &m=*norm.mapping;
466 const Norm &cNorm=getNormRef(c);
468 if(norm.mappingType==Norm::ROUND_TRIP) {
470 if(cNorm.mappingType!=Norm::ROUND_TRIP) {
510 if(norm.mappingType==Norm::ROUND_TRIP && prev!=0) {
528 if(norm.rawMapping==NULL) {
530 norm.rawMapping=norm.mapping;
532 delete norm.mapping;
534 norm.mapping=decomposed;
535 // Not norm.setMappingCP(); because the original mapping
602 Normalizer2DataBuilder::reorder(Norm *p, BuilderReorderingBuffer &buffer) {
646 const Norm *starterNorm=&getNormRef(starter);
677 int32_t Normalizer2DataBuilder::writeMapping(UChar32 c, const Norm *p, UnicodeString &dataString) {
757 void Normalizer2DataBuilder::writeCompositions(UChar32 c, const Norm *p, UnicodeString &dataString) {
833 Norm *p=norms+value;
859 (writer.maybeYesCompositions.length()<<Norm::OFFSET_SHIFT)|
860 Norm::OFFSET_MAYBE_YES;
866 (writer.yesYesCompositions.length()<<Norm::OFFSET_SHIFT)|
867 Norm::OFFSET_YES_YES;
870 } else if(p->mappingType==Norm::ROUND_TRIP) {
874 p->offset=(offset<<Norm::OFFSET_SHIFT)|Norm::OFFSET_YES_NO_MAPPING_AND_COMPOSITION;
879 p->offset=(offset<<Norm::OFFSET_SHIFT)|Norm::OFFSET_YES_NO_MAPPING_ONLY;
903 p->offset=(delta<<Norm::OFFSET_SHIFT)|Norm::OFFSET_DELTA;
915 p->offset=((previousOffset-1)<<Norm::OFFSET_SHIFT)|Norm::OFFSET_NO_NO;
920 p->offset=(offset<<Norm::OFFSET_SHIFT)|Norm::OFFSET_NO_NO;
937 const Norm *p=norms+value;
938 int32_t offset=p->offset>>Norm::OFFSET_SHIFT;
942 switch(p->offset&Norm::OFFSET_MASK) {
943 case Norm::OFFSET_NONE:
954 case Norm::OFFSET_MAYBE_YES:
958 case Norm::OFFSET_YES_YES:
961 case Norm::OFFSET_YES_NO_MAPPING_AND_COMPOSITION:
965 case Norm::OFFSET_YES_NO_MAPPING_ONLY:
969 case Norm::OFFSET_NO_NO:
973 case Norm::OFFSET_DELTA:
1058 const Norm &norm=norms[i];
1059 if(norm.hasMapping()) {
1060 if(norm.compositions!=NULL) {