2 **********************************************************************
3 * Copyright (c) 2002-2006, International Business Machines Corporation
4 * and others. All Rights Reserved.
5 **********************************************************************
6 * Date Name Description
7 * 01/14/2002 aliu Creation.
8 **********************************************************************
11 #include "unicode/utypes.h"
13 #if !UCONFIG_NO_TRANSLITERATION
19 #include "unicode/parsepos.h"
20 #include "unicode/translit.h"
21 #include "unicode/uchar.h"
22 #include "unicode/uniset.h"
23 #include "unicode/unistr.h"
24 #include "unicode/utrans.h"
30 static const UChar ID_DELIM
= 0x003B; // ;
31 static const UChar TARGET_SEP
= 0x002D; // -
32 static const UChar VARIANT_SEP
= 0x002F; // /
33 static const UChar OPEN_REV
= 0x0028; // (
34 static const UChar CLOSE_REV
= 0x0029; // )
36 //static const UChar EMPTY[] = {0}; // ""
37 static const UChar ANY
[] = {65,110,121,0}; // "Any"
38 static const UChar ANY_NULL
[] = {65,110,121,45,78,117,108,108,0}; // "Any-Null"
40 static const int32_t FORWARD
= UTRANS_FORWARD
;
41 static const int32_t REVERSE
= UTRANS_REVERSE
;
43 static Hashtable
* SPECIAL_INVERSES
= NULL
;
46 * The mutex controlling access to SPECIAL_INVERSES
50 TransliteratorIDParser::Specs::Specs(const UnicodeString
& s
, const UnicodeString
& t
,
51 const UnicodeString
& v
, UBool sawS
,
52 const UnicodeString
& f
) {
60 TransliteratorIDParser::SingleID::SingleID(const UnicodeString
& c
, const UnicodeString
& b
,
61 const UnicodeString
& f
) {
67 TransliteratorIDParser::SingleID::SingleID(const UnicodeString
& c
, const UnicodeString
& b
) {
72 Transliterator
* TransliteratorIDParser::SingleID::createInstance() {
74 if (basicID
.length() == 0) {
75 t
= createBasicInstance(ANY_NULL
, &canonID
);
77 t
= createBasicInstance(basicID
, &canonID
);
80 if (filter
.length() != 0) {
81 UErrorCode ec
= U_ZERO_ERROR
;
82 UnicodeSet
*set
= new UnicodeSet(filter
, ec
);
95 * Parse a single ID, that is, an ID of the general form
96 * "[f1] s1-t1/v1 ([f2] s2-t3/v2)", with the parenthesized element
97 * optional, the filters optional, and the variants optional.
98 * @param id the id to be parsed
99 * @param pos INPUT-OUTPUT parameter. On input, the position of
100 * the first character to parse. On output, the position after
101 * the last character parsed.
102 * @param dir the direction. If the direction is REVERSE then the
103 * SingleID is constructed for the reverse direction.
104 * @return a SingleID object or NULL
106 TransliteratorIDParser::SingleID
*
107 TransliteratorIDParser::parseSingleID(const UnicodeString
& id
, int32_t& pos
,
108 int32_t dir
, UErrorCode
& status
) {
112 // The ID will be of the form A, A(), A(B), or (B), where
113 // A and B are filter IDs.
114 Specs
* specsA
= NULL
;
115 Specs
* specsB
= NULL
;
116 UBool sawParen
= FALSE
;
118 // On the first pass, look for (B) or (). If this fails, then
119 // on the second pass, look for A, A(B), or A().
120 for (int32_t pass
=1; pass
<=2; ++pass
) {
122 specsA
= parseFilterID(id
, pos
, TRUE
);
123 if (specsA
== NULL
) {
128 if (ICU_Utility::parseChar(id
, pos
, OPEN_REV
)) {
130 if (!ICU_Utility::parseChar(id
, pos
, CLOSE_REV
)) {
131 specsB
= parseFilterID(id
, pos
, TRUE
);
132 // Must close with a ')'
133 if (specsB
== NULL
|| !ICU_Utility::parseChar(id
, pos
, CLOSE_REV
)) {
143 // Assemble return results
146 if (dir
== FORWARD
) {
147 SingleID
* b
= specsToID(specsB
, FORWARD
);
148 single
= specsToID(specsA
, FORWARD
);
149 single
->canonID
.append(OPEN_REV
)
150 .append(b
->canonID
).append(CLOSE_REV
);
151 if (specsA
!= NULL
) {
152 single
->filter
= specsA
->filter
;
156 SingleID
* a
= specsToID(specsA
, FORWARD
);
157 single
= specsToID(specsB
, FORWARD
);
158 single
->canonID
.append(OPEN_REV
)
159 .append(a
->canonID
).append(CLOSE_REV
);
160 if (specsB
!= NULL
) {
161 single
->filter
= specsB
->filter
;
166 // assert(specsA != NULL);
167 if (dir
== FORWARD
) {
168 single
= specsToID(specsA
, FORWARD
);
170 single
= specsToSpecialInverse(*specsA
, status
);
171 if (single
== NULL
) {
172 single
= specsToID(specsA
, REVERSE
);
175 single
->filter
= specsA
->filter
;
185 * Parse a filter ID, that is, an ID of the general form
186 * "[f1] s1-t1/v1", with the filters optional, and the variants optional.
187 * @param id the id to be parsed
188 * @param pos INPUT-OUTPUT parameter. On input, the position of
189 * the first character to parse. On output, the position after
190 * the last character parsed.
191 * @return a SingleID object or null if the parse fails
193 TransliteratorIDParser::SingleID
*
194 TransliteratorIDParser::parseFilterID(const UnicodeString
& id
, int32_t& pos
) {
198 Specs
* specs
= parseFilterID(id
, pos
, TRUE
);
204 // Assemble return results
205 SingleID
* single
= specsToID(specs
, FORWARD
);
206 single
->filter
= specs
->filter
;
212 * Parse a global filter of the form "[f]" or "([f])", depending
214 * @param id the pattern the parse
215 * @param pos INPUT-OUTPUT parameter. On input, the position of
216 * the first character to parse. On output, the position after
217 * the last character parsed.
218 * @param dir the direction.
219 * @param withParens INPUT-OUTPUT parameter. On entry, if
220 * withParens is 0, then parens are disallowed. If it is 1,
221 * then parens are requires. If it is -1, then parens are
222 * optional, and the return result will be set to 0 or 1.
223 * @param canonID OUTPUT parameter. The pattern for the filter
224 * added to the canonID, either at the end, if dir is FORWARD, or
225 * at the start, if dir is REVERSE. The pattern will be enclosed
226 * in parentheses if appropriate, and will be suffixed with an
227 * ID_DELIM character. May be NULL.
228 * @return a UnicodeSet object or NULL. A non-NULL results
229 * indicates a successful parse, regardless of whether the filter
230 * applies to the given direction. The caller should discard it
231 * if withParens != (dir == REVERSE).
233 UnicodeSet
* TransliteratorIDParser::parseGlobalFilter(const UnicodeString
& id
, int32_t& pos
,
236 UnicodeString
* canonID
) {
237 UnicodeSet
* filter
= NULL
;
240 if (withParens
== -1) {
241 withParens
= ICU_Utility::parseChar(id
, pos
, OPEN_REV
) ? 1 : 0;
242 } else if (withParens
== 1) {
243 if (!ICU_Utility::parseChar(id
, pos
, OPEN_REV
)) {
249 ICU_Utility::skipWhitespace(id
, pos
, TRUE
);
251 if (UnicodeSet::resemblesPattern(id
, pos
)) {
252 ParsePosition
ppos(pos
);
253 UErrorCode ec
= U_ZERO_ERROR
;
254 filter
= new UnicodeSet(id
, ppos
, USET_IGNORE_SPACE
, NULL
, ec
);
266 UnicodeString pattern
;
267 id
.extractBetween(pos
, ppos
.getIndex(), pattern
);
268 pos
= ppos
.getIndex();
270 if (withParens
== 1 && !ICU_Utility::parseChar(id
, pos
, CLOSE_REV
)) {
275 // In the forward direction, append the pattern to the
276 // canonID. In the reverse, insert it at zero, and invert
277 // the presence of parens ("A" <-> "(A)").
278 if (canonID
!= NULL
) {
279 if (dir
== FORWARD
) {
280 if (withParens
== 1) {
281 pattern
.insert(0, OPEN_REV
);
282 pattern
.append(CLOSE_REV
);
284 canonID
->append(pattern
).append(ID_DELIM
);
286 if (withParens
== 0) {
287 pattern
.insert(0, OPEN_REV
);
288 pattern
.append(CLOSE_REV
);
290 canonID
->insert(0, pattern
);
291 canonID
->insert(pattern
.length(), ID_DELIM
);
300 static void U_CALLCONV
_deleteSingleID(void* obj
) {
301 delete (TransliteratorIDParser::SingleID
*) obj
;
304 static void U_CALLCONV
_deleteTransliteratorTrIDPars(void* obj
) {
305 delete (Transliterator
*) obj
;
310 * Parse a compound ID, consisting of an optional forward global
311 * filter, a separator, one or more single IDs delimited by
312 * separators, an an optional reverse global filter. The
313 * separator is a semicolon. The global filters are UnicodeSet
314 * patterns. The reverse global filter must be enclosed in
316 * @param id the pattern the parse
317 * @param dir the direction.
318 * @param canonID OUTPUT parameter that receives the canonical ID,
319 * consisting of canonical IDs for all elements, as returned by
320 * parseSingleID(), separated by semicolons. Previous contents
322 * @param list OUTPUT parameter that receives a list of SingleID
323 * objects representing the parsed IDs. Previous contents are
325 * @param globalFilter OUTPUT parameter that receives a pointer to
326 * a newly created global filter for this ID in this direction, or
327 * NULL if there is none.
328 * @return TRUE if the parse succeeds, that is, if the entire
329 * id is consumed without syntax error.
331 UBool
TransliteratorIDParser::parseCompoundID(const UnicodeString
& id
, int32_t dir
,
332 UnicodeString
& canonID
,
334 UnicodeSet
*& globalFilter
) {
335 UErrorCode ec
= U_ZERO_ERROR
;
338 int32_t withParens
= 1;
339 list
.removeAllElements();
344 // Parse leading global filter, if any
345 withParens
= 0; // parens disallowed
346 filter
= parseGlobalFilter(id
, pos
, dir
, withParens
, &canonID
);
347 if (filter
!= NULL
) {
348 if (!ICU_Utility::parseChar(id
, pos
, ID_DELIM
)) {
349 // Not a global filter; backup and resume
353 if (dir
== FORWARD
) {
354 globalFilter
= filter
;
361 UBool sawDelimiter
= TRUE
;
363 SingleID
* single
= parseSingleID(id
, pos
, dir
, ec
);
364 if (single
== NULL
) {
367 if (dir
== FORWARD
) {
368 list
.addElement(single
, ec
);
370 list
.insertElementAt(single
, 0, ec
);
375 if (!ICU_Utility::parseChar(id
, pos
, ID_DELIM
)) {
376 sawDelimiter
= FALSE
;
381 if (list
.size() == 0) {
385 // Construct canonical ID
386 for (i
=0; i
<list
.size(); ++i
) {
387 SingleID
* single
= (SingleID
*) list
.elementAt(i
);
388 canonID
.append(single
->canonID
);
389 if (i
!= (list
.size()-1)) {
390 canonID
.append(ID_DELIM
);
394 // Parse trailing global filter, if any, and only if we saw
395 // a trailing delimiter after the IDs.
397 withParens
= 1; // parens required
398 filter
= parseGlobalFilter(id
, pos
, dir
, withParens
, &canonID
);
399 if (filter
!= NULL
) {
400 // Don't require trailing ';', but parse it if present
401 ICU_Utility::parseChar(id
, pos
, ID_DELIM
);
403 if (dir
== REVERSE
) {
404 globalFilter
= filter
;
412 // Trailing unparsed text is a syntax error
413 ICU_Utility::skipWhitespace(id
, pos
, TRUE
);
414 if (pos
!= id
.length()) {
421 UObjectDeleter
*save
= list
.setDeleter(_deleteSingleID
);
422 list
.removeAllElements();
423 list
.setDeleter(save
);
430 * Convert the elements of the 'list' vector, which are SingleID
431 * objects, into actual Transliterator objects. In the course of
432 * this, some (or all) entries may be removed. If all entries
433 * are removed, the NULL transliterator will be added.
435 * Delete entries with empty basicIDs; these are generated by
436 * elements like "(A)" in the forward direction, or "A()" in
437 * the reverse. THIS MAY RESULT IN AN EMPTY VECTOR. Convert
438 * SingleID entries to actual transliterators.
440 * @param list vector of SingleID objects. On exit, vector
441 * of one or more Transliterators.
442 * @return new value of insertIndex. The index will shift if
443 * there are empty items, like "(Lower)", with indices less than
446 void TransliteratorIDParser::instantiateList(UVector
& list
,
452 tlist
.setDeleter(_deleteTransliteratorTrIDPars
);
456 for (i
=0; i
<=list
.size(); ++i
) { // [sic]: i<=list.size()
457 // We run the loop too long by one, so we can
458 // do an insert after the last element
459 if (i
==list
.size()) {
463 SingleID
* single
= (SingleID
*) list
.elementAt(i
);
464 if (single
->basicID
.length() != 0) {
465 t
= single
->createInstance();
470 tlist
.addElement(t
, ec
);
478 // An empty list is equivalent to a NULL transliterator.
479 if (tlist
.size() == 0) {
480 t
= createBasicInstance(ANY_NULL
, NULL
);
482 // Should never happen
483 ec
= U_INTERNAL_TRANSLITERATOR_ERROR
;
485 tlist
.addElement(t
, ec
);
493 UObjectDeleter
*save
= list
.setDeleter(_deleteSingleID
);
494 list
.removeAllElements();
497 list
.setDeleter(_deleteTransliteratorTrIDPars
);
499 while (tlist
.size() > 0) {
500 t
= (Transliterator
*) tlist
.orphanElementAt(0);
501 list
.addElement(t
, ec
);
504 list
.removeAllElements();
510 list
.setDeleter(save
);
514 * Parse an ID into pieces. Take IDs of the form T, T/V, S-T,
515 * S-T/V, or S/V-T. If the source is missing, return a source of
517 * @param id the id string, in any of several forms
518 * @return an array of 4 strings: source, target, variant, and
519 * isSourcePresent. If the source is not present, ANY will be
520 * given as the source, and isSourcePresent will be NULL. Otherwise
521 * isSourcePresent will be non-NULL. The target may be empty if the
522 * id is not well-formed. The variant may be empty.
524 void TransliteratorIDParser::IDtoSTV(const UnicodeString
& id
,
525 UnicodeString
& source
,
526 UnicodeString
& target
,
527 UnicodeString
& variant
,
528 UBool
& isSourcePresent
) {
533 int32_t sep
= id
.indexOf(TARGET_SEP
);
534 int32_t var
= id
.indexOf(VARIANT_SEP
);
538 isSourcePresent
= FALSE
;
541 // Form: T/V or T (or /V)
542 id
.extractBetween(0, var
, target
);
543 id
.extractBetween(var
, id
.length(), variant
);
544 } else if (sep
< var
) {
545 // Form: S-T/V or S-T (or -T/V or -T)
547 id
.extractBetween(0, sep
, source
);
548 isSourcePresent
= TRUE
;
550 id
.extractBetween(++sep
, var
, target
);
551 id
.extractBetween(var
, id
.length(), variant
);
553 // Form: (S/V-T or /V-T)
555 id
.extractBetween(0, var
, source
);
556 isSourcePresent
= TRUE
;
558 id
.extractBetween(var
, sep
++, variant
);
559 id
.extractBetween(sep
, id
.length(), target
);
562 if (variant
.length() > 0) {
563 variant
.remove(0, 1);
568 * Given source, target, and variant strings, concatenate them into a
569 * full ID. If the source is empty, then "Any" will be used for the
570 * source, so the ID will always be of the form s-t/v or s-t.
572 void TransliteratorIDParser::STVtoID(const UnicodeString
& source
,
573 const UnicodeString
& target
,
574 const UnicodeString
& variant
,
577 if (id
.length() == 0) {
580 id
.append(TARGET_SEP
).append(target
);
581 if (variant
.length() != 0) {
582 id
.append(VARIANT_SEP
).append(variant
);
584 // NUL-terminate the ID string for getTerminatedBuffer.
585 // This prevents valgrind and Purify warnings.
587 id
.truncate(id
.length()-1);
591 * Register two targets as being inverses of one another. For
592 * example, calling registerSpecialInverse("NFC", "NFD", TRUE) causes
593 * Transliterator to form the following inverse relationships:
598 * Any-NFD => Any-NFC</pre>
600 * (Without the special inverse registration, the inverse of NFC
601 * would be NFC-Any.) Note that NFD is shorthand for Any-NFD, but
602 * that the presence or absence of "Any-" is preserved.
604 * <p>The relationship is symmetrical; registering (a, b) is
605 * equivalent to registering (b, a).
607 * <p>The relevant IDs must still be registered separately as
608 * factories or classes.
610 * <p>Only the targets are specified. Special inverses always
611 * have the form Any-Target1 <=> Any-Target2. The target should
612 * have canonical casing (the casing desired to be produced when
613 * an inverse is formed) and should contain no whitespace or other
614 * extraneous characters.
616 * @param target the target against which to register the inverse
617 * @param inverseTarget the inverse of target, that is
618 * Any-target.getInverse() => Any-inverseTarget
619 * @param bidirectional if TRUE, register the reverse relation
620 * as well, that is, Any-inverseTarget.getInverse() => Any-target
622 void TransliteratorIDParser::registerSpecialInverse(const UnicodeString
& target
,
623 const UnicodeString
& inverseTarget
,
625 UErrorCode
&status
) {
627 if (U_FAILURE(status
)) {
631 // If target == inverseTarget then force bidirectional => FALSE
632 if (bidirectional
&& 0==target
.caseCompare(inverseTarget
, U_FOLD_CASE_DEFAULT
)) {
633 bidirectional
= FALSE
;
639 SPECIAL_INVERSES
->put(target
, new UnicodeString(inverseTarget
), status
);
641 SPECIAL_INVERSES
->put(inverseTarget
, new UnicodeString(target
), status
);
645 //----------------------------------------------------------------
646 // Private implementation
647 //----------------------------------------------------------------
650 * Parse an ID into component pieces. Take IDs of the form T,
651 * T/V, S-T, S-T/V, or S/V-T. If the source is missing, return a
653 * @param id the id string, in any of several forms
654 * @param pos INPUT-OUTPUT parameter. On input, pos is the
655 * offset of the first character to parse in id. On output,
656 * pos is the offset after the last parsed character. If the
657 * parse failed, pos will be unchanged.
658 * @param allowFilter2 if TRUE, a UnicodeSet pattern is allowed
659 * at any location between specs or delimiters, and is returned
660 * as the fifth string in the array.
661 * @return a Specs object, or NULL if the parse failed. If
662 * neither source nor target was seen in the parsed id, then the
663 * parse fails. If allowFilter is TRUE, then the parsed filter
664 * pattern is returned in the Specs object, otherwise the returned
665 * filter reference is NULL. If the parse fails for any reason
668 TransliteratorIDParser::Specs
*
669 TransliteratorIDParser::parseFilterID(const UnicodeString
& id
, int32_t& pos
,
672 UnicodeString source
;
673 UnicodeString target
;
674 UnicodeString variant
;
675 UnicodeString filter
;
677 int32_t specCount
= 0;
680 // This loop parses one of the following things with each
681 // pass: a filter, a delimiter character (either '-' or '/'),
682 // or a spec (source, target, or variant).
684 ICU_Utility::skipWhitespace(id
, pos
, TRUE
);
685 if (pos
== id
.length()) {
690 if (allowFilter
&& filter
.length() == 0 &&
691 UnicodeSet::resemblesPattern(id
, pos
)) {
693 ParsePosition
ppos(pos
);
694 UErrorCode ec
= U_ZERO_ERROR
;
695 UnicodeSet
set(id
, ppos
, USET_IGNORE_SPACE
, NULL
, ec
);
700 id
.extractBetween(pos
, ppos
.getIndex(), filter
);
701 pos
= ppos
.getIndex();
705 if (delimiter
== 0) {
706 UChar c
= id
.charAt(pos
);
707 if ((c
== TARGET_SEP
&& target
.length() == 0) ||
708 (c
== VARIANT_SEP
&& variant
.length() == 0)) {
715 // We are about to try to parse a spec with no delimiter
716 // when we can no longer do so (we can only do so at the
718 if (delimiter
== 0 && specCount
> 0) {
722 UnicodeString spec
= ICU_Utility::parseUnicodeIdentifier(id
, pos
);
723 if (spec
.length() == 0) {
724 // Note that if there was a trailing delimiter, we
725 // consume it. So Foo-, Foo/, Foo-Bar/, and Foo/Bar-
745 // A spec with no prior character is either source or target,
746 // depending on whether an explicit "-target" was seen.
747 if (first
.length() != 0) {
748 if (target
.length() == 0) {
755 // Must have either source or target
756 if (source
.length() == 0 && target
.length() == 0) {
761 // Empty source or target defaults to ANY
762 UBool sawSource
= TRUE
;
763 if (source
.length() == 0) {
767 if (target
.length() == 0) {
771 return new Specs(source
, target
, variant
, sawSource
, filter
);
775 * Givens a Spec object, convert it to a SingleID object. The
776 * Spec object is a more unprocessed parse result. The SingleID
777 * object contains information about canonical and basic IDs.
778 * @return a SingleID; never returns NULL. Returned object always
779 * has 'filter' field of NULL.
781 TransliteratorIDParser::SingleID
*
782 TransliteratorIDParser::specsToID(const Specs
* specs
, int32_t dir
) {
783 UnicodeString canonID
;
784 UnicodeString basicID
;
785 UnicodeString basicPrefix
;
788 if (dir
== FORWARD
) {
789 if (specs
->sawSource
) {
790 buf
.append(specs
->source
).append(TARGET_SEP
);
792 basicPrefix
= specs
->source
;
793 basicPrefix
.append(TARGET_SEP
);
795 buf
.append(specs
->target
);
797 buf
.append(specs
->target
).append(TARGET_SEP
).append(specs
->source
);
799 if (specs
->variant
.length() != 0) {
800 buf
.append(VARIANT_SEP
).append(specs
->variant
);
802 basicID
= basicPrefix
;
804 if (specs
->filter
.length() != 0) {
805 buf
.insert(0, specs
->filter
);
809 return new SingleID(canonID
, basicID
);
813 * Given a Specs object, return a SingleID representing the
814 * special inverse of that ID. If there is no special inverse
816 * @return a SingleID or NULL. Returned object always has
817 * 'filter' field of NULL.
819 TransliteratorIDParser::SingleID
*
820 TransliteratorIDParser::specsToSpecialInverse(const Specs
& specs
, UErrorCode
&status
) {
821 if (0!=specs
.source
.caseCompare(ANY
, U_FOLD_CASE_DEFAULT
)) {
826 UnicodeString
* inverseTarget
;
830 inverseTarget
= (UnicodeString
*) SPECIAL_INVERSES
->get(specs
.target
);
833 if (inverseTarget
!= NULL
) {
834 // If the original ID contained "Any-" then make the
835 // special inverse "Any-Foo"; otherwise make it "Foo".
836 // So "Any-NFC" => "Any-NFD" but "NFC" => "NFD".
838 if (specs
.filter
.length() != 0) {
839 buf
.append(specs
.filter
);
841 if (specs
.sawSource
) {
842 buf
.append(ANY
).append(TARGET_SEP
);
844 buf
.append(*inverseTarget
);
846 UnicodeString
basicID(ANY
);
847 basicID
.append(TARGET_SEP
).append(*inverseTarget
);
849 if (specs
.variant
.length() != 0) {
850 buf
.append(VARIANT_SEP
).append(specs
.variant
);
851 basicID
.append(VARIANT_SEP
).append(specs
.variant
);
853 return new SingleID(buf
, basicID
);
859 * Glue method to get around access problems in C++. This would
860 * ideally be inline but we want to avoid a circular header
863 Transliterator
* TransliteratorIDParser::createBasicInstance(const UnicodeString
& id
, const UnicodeString
* canonID
) {
864 return Transliterator::createBasicInstance(id
, canonID
);
868 * Initialize static memory.
870 void TransliteratorIDParser::init(UErrorCode
&status
) {
871 if (SPECIAL_INVERSES
!= NULL
) {
875 Hashtable
* special_inverses
= new Hashtable(TRUE
, status
);
876 special_inverses
->setValueDeleter(uhash_deleteUnicodeString
);
880 if (SPECIAL_INVERSES
== NULL
) {
881 SPECIAL_INVERSES
= special_inverses
;
882 special_inverses
= NULL
;
885 delete special_inverses
; /*null instance*/
887 ucln_i18n_registerCleanup(UCLN_I18N_TRANSLITERATOR
, transliterator_cleanup
);
891 * Free static memory.
893 void TransliteratorIDParser::cleanup() {
894 if (SPECIAL_INVERSES
) {
895 delete SPECIAL_INVERSES
;
896 SPECIAL_INVERSES
= NULL
;
903 #endif /* #if !UCONFIG_NO_TRANSLITERATION */