Logo Search packages:      
Sourcecode: icu version File versions  Download package

int16_t TransliterationRule::getIndexValue (  )  const

Internal method. Returns 8-bit index value for this rule. This is the low byte of the first character of the key, unless the first character of the key is a set. If it's a set, or otherwise can match multiple keys, the index value is -1.

Returns:
8-bit index value for this rule.
Internal method. Returns 8-bit index value for this rule. This is the low byte of the first character of the key, unless the first character of the key is a set. If it's a set, or otherwise can match multiple keys, the index value is -1.

Definition at line 218 of file rbt_rule.cpp.

References anteContextLength, UnicodeString::char32At(), data, UnicodeString::length(), TransliterationRuleData::lookupMatcher(), NULL, and pattern.

Referenced by TransliterationRuleSet::freeze().

                                                 {
    if (anteContextLength == pattern.length()) {
        // A pattern with just ante context {such as foo)>bar} can
        // match any key.
        return -1;
    }
    UChar32 c = pattern.char32At(anteContextLength);
    return (int16_t)(data->lookupMatcher(c) == NULL ? (c & 0xFF) : -1);
}


Generated by  Doxygen 1.6.0   Back to index