Home | History | Annotate | Download | only in i18n

Lines Matching refs:confidence

32 // UTF-16 confidence calculation. Very simple minded, but better than nothing.
33 // Any 8 bit non-control characters bump the confidence up. These have a zero high byte,
38 static int32_t adjustConfidence(UChar codeUnit, int32_t confidence) {
40 confidence -= 10;
42 confidence += 10;
44 if (confidence < 0) {
45 confidence = 0;
46 } else if (confidence > 100) {
47 confidence = 100;
49 return confidence;
56 int32_t confidence = 10;
63 confidence = 100;
66 confidence = adjustConfidence(codeUnit, confidence);
67 if (confidence == 0 || confidence == 100) {
71 if (bytesToCheck < 4 && confidence < 100) {
72 confidence = 0;
74 results->set(textIn, this, confidence);
75 return (confidence > 0);
91 int32_t confidence = 10;
98 confidence = 100; // UTF-16 BOM
100 confidence = 0; // UTF-32 BOM
104 confidence = adjustConfidence(codeUnit, confidence);
105 if (confidence == 0 || confidence == 100) {
109 if (bytesToCheck < 4 && confidence < 100) {
110 confidence = 0;
112 results->set(textIn, this, confidence);
113 return (confidence > 0);
128 int32_t confidence = 0;
145 // Cook up some sort of confidence score, based on presense of a BOM
148 confidence = 100;
150 confidence = 80;
152 confidence = 100;
154 confidence = 80;
157 confidence = 25;
160 results->set(textIn, this, confidence);
161 return (confidence > 0);