Deprecated
This API is ICU internal only.
RuleBasedTransliterator is a transliterator
built from a set of rules as defined for
Transliterator#createFromRules(String, String, int).
See the class Transliterator documentation for the rule syntax.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private final RuleBasedTransliterator. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | addSourceTargetSet(UnicodeSet filter, UnicodeSet sourceSet, UnicodeSet
TODO targetSet)Overrides com.
Deprecated
This API is ICU internal only.
Returns the set of all characters that may be generated as
replacement text by this transliterator, filtered by BOTH the input filter, and the current getFilter().
|
| protected void | handleTransliterate(Replaceable
the buffer holding transliterated and
untransliterated text text, Transliterator.the indices indicating the start, limit, context
start, and context limit of the text. index,if true, assume more text may be inserted at
incremental)pos.limit and act accordingly. Otherwise,
transliterate all text between pos.start and
pos.limit and move pos.start up to
pos.limit.Implements abstract com.
Deprecated
This API is ICU internal only.
Implements Transliterator#handleTransliterate.
|
| public Transliterator | |
| public String | Returns: rules stringif true then convert unprintable
character to their hex escape representations, \\uxxxx or
\\Uxxxxxxxx. Unprintable characters are those other than
U+000A, U+0020..U+007E. escapeUnprintable)Overrides com.
Deprecated
This API is ICU internal only.
Return a representation of this transliterator as source rules.
|
| data | back to summary |
|---|---|
| private final RuleBasedTransliterator. | |
| RuleBasedTransliterator | back to summary |
|---|---|
| pack-priv RuleBasedTransliterator(String ID, RuleBasedTransliterator. | |
| addSourceTargetSet | back to summary |
|---|---|
| public void addSourceTargetSet(UnicodeSet filter, UnicodeSet sourceSet, UnicodeSet targetSet) Overrides com. Doc from com. Deprecated This API is ICU internal only. Returns the set of all characters that may be generated as replacement text by this transliterator, filtered by BOTH the input filter, and the current getFilter(). SHOULD BE OVERRIDDEN BY SUBCLASSES. It is probably an error for any transliterator to NOT override this, but we can't force them to for backwards compatibility. Other methods vector through this. When gathering the information on source and target, the compound transliterator makes things complicated. For example, suppose we have: Global FILTER = [ax] a > b; :: NULL; b > c; x > d;While the filter just allows a and x, b is an intermediate result, which could produce c. So the source and target sets cannot be gathered independently. What we have to do is filter the sources for the first transliterator according to the global filter, intersect that transliterator's filter. Based on that we get the target. The next transliterator gets as a global filter (global + last target). And so on. There is another complication: Global FILTER = [ax] a >|b; b >c;Even though b would be filtered from the input, whenever we have a backup, it could be part of the input. So ideally we will change the global filter as we go.
| |
| handleTransliterate | back to summary |
|---|---|
| protected void handleTransliterate(Replaceable text, Transliterator. Implements abstract com. Deprecated This API is ICU internal only. Implements
| |
| safeClone | back to summary |
|---|---|
| public Transliterator safeClone()
Deprecated This API is ICU internal only. Temporary hack for registry problem. Needs to be replaced by better architecture.
| |
| toRules | back to summary |
|---|---|
| public String toRules(boolean escapeUnprintable) Overrides com. Deprecated This API is ICU internal only. Return a representation of this transliterator as source rules. These rules will produce an equivalent transliterator if used to construct a new transliterator. | |
| Modifier and Type | Field and Description |
|---|---|
| public TransliterationRuleSet | ruleSet
Rule table. |
| pack-priv Map | variableNames
Map variable name (String) to variable (char[]). |
| pack-priv Object[] | variables
Map category variable (Character) to UnicodeMatcher or UnicodeReplacer. |
| pack-priv char | variablesBase
The character that represents variables[0]. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public UnicodeMatcher | lookupMatcher(int standIn)
Return the UnicodeMatcher represented by the given character, or null if none. |
| public UnicodeReplacer | lookupReplacer(int standIn)
Return the UnicodeReplacer represented by the given character, or null if none. |
| ruleSet | back to summary |
|---|---|
| public TransliterationRuleSet ruleSet Rule table. May be empty. | |
| variableNames | back to summary |
|---|---|
| pack-priv Map<String, char[]> variableNames Map variable name (String) to variable (char[]). A variable name corresponds to zero or more characters, stored in a char[] array in this hash. One or more of these chars may also correspond to a UnicodeSet, in which case the character in the char[] in this hash is a stand-in: it is an index for a secondary lookup in data.variables. The stand-in also represents the UnicodeSet in the stored rules. | |
| variables | back to summary |
|---|---|
| pack-priv Object[] variables Map category variable (Character) to UnicodeMatcher or UnicodeReplacer. Variables that correspond to a set of characters are mapped from variable name to a stand-in character in data.variableNames. The stand-in then serves as a key in this hash to lookup the actual UnicodeSet object. In addition, the stand-in is stored in the rule text to represent the set of characters. variables[i] represents character (variablesBase + i). | |
| variablesBase | back to summary |
|---|---|
| pack-priv char variablesBase The character that represents variables[0]. Characters variablesBase through variablesBase + variables.length - 1 represent UnicodeSet objects. | |
| Data | back to summary |
|---|---|
| public Data() | |
| lookupMatcher | back to summary |
|---|---|
| public UnicodeMatcher lookupMatcher(int standIn) Return the UnicodeMatcher represented by the given character, or null if none. | |
| lookupReplacer | back to summary |
|---|---|
| public UnicodeReplacer lookupReplacer(int standIn) Return the UnicodeReplacer represented by the given character, or null if none. | |