Class RemoveTransliterator

  • All Implemented Interfaces:
    StringTransform, Transform<java.lang.String,​java.lang.String>

    class RemoveTransliterator
    extends Transliterator
    A transliterator that removes characters. This is useful in conjunction with a filter.
    • Field Detail

      • _ID

        private static final java.lang.String _ID
        ID for this transliterator.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RemoveTransliterator

        public RemoveTransliterator()
        Constructs a transliterator.
    • Method Detail

      • register

        static void register()
        System registration hook.
      • addSourceTargetSet

        public void addSourceTargetSet​(UnicodeSet inputFilter,
                                       UnicodeSet sourceSet,
                                       UnicodeSet targetSet)
        Description copied from class: Transliterator
        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.
        Overrides:
        addSourceTargetSet in class Transliterator
        targetSet - TODO
        See Also:
        Transliterator.getTargetSet()