Exemplo n.º 1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="id">The ID of the form S-T or S-T/V, where T is theTarget
 /// and V is theVariant.  Must not be empty.</param>
 /// <param name="filter">The Unicode filter.</param>
 /// <param name="target2">The target name.</param>
 /// <param name="targetScript2">The script code corresponding to theTarget.</param>
 /// <param name="widthFix2">The <see cref="Transliterator"/> width fix.</param>
 /// <param name="cache2">The <see cref="ConcurrentDictionary{TKey, TValue}"/> object for cache.</param>
 public AnyTransliterator(string id, UnicodeFilter filter, string target2,
                          int targetScript2, Transliterator widthFix2, ConcurrentDictionary <int, Transliterator> cache2)
     : base(id, filter)
 {
     targetScript = targetScript2;
     cache        = cache2;
     target       = target2;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Temporary hack for registry problem. Needs to be replaced by better architecture.
        /// </summary>
        public virtual Transliterator SafeClone()
        {
            UnicodeFilter filter = Filter;

            if (filter != null && filter is UnicodeSet)
            {
                filter = new UnicodeSet((UnicodeSet)filter);
            }
            return(new CompoundTransliterator(ID, filter, trans, numAnonymousRBTs));
        }
Exemplo n.º 3
0
        public Transliterator SafeClone()
        {
            UnicodeFilter filter = Filter;

            if (filter != null && filter is UnicodeSet)
            {
                filter = new UnicodeSet((UnicodeSet)filter);
            }
            return(new RuleBasedTransliterator(ID, data, filter));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Temporary hack for registry problem. Needs to be replaced by better architecture.
        /// </summary>
        public virtual Transliterator SafeClone()
        {
            UnicodeFilter filter = Filter;

            if (filter != null && filter is UnicodeSet)
            {
                filter = new UnicodeSet((UnicodeSet)filter);
            }
            return(new AnyTransliterator(ID, filter, target, targetScript, widthFix, cache));
        }
Exemplo n.º 5
0
 /// <summary>
 /// Constructs a transliterator.
 /// </summary>
 /// <param name="filter"></param>
 public UnicodeNameTransliterator(UnicodeFilter filter)
     : base(_ID, filter)
 {
 }
Exemplo n.º 6
0
 public BreakTransliterator(string id, UnicodeFilter filter)
     : this(id, filter, null, " ")
 {
 }
Exemplo n.º 7
0
 public BreakTransliterator(string id, UnicodeFilter filter, BreakIterator bi, string insertion)
     : base(id, filter)
 {
     this.bi        = bi;
     this.insertion = insertion;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Internal method for SafeClone...
 /// </summary>
 /// <param name="id"></param>
 /// <param name="filter2"></param>
 /// <param name="trans2"></param>
 /// <param name="numAnonymousRBTs2"></param>
 internal CompoundTransliterator(string id, UnicodeFilter filter2, Transliterator[] trans2, int numAnonymousRBTs2)
     : base(id, filter2)
 {
     trans            = trans2;
     numAnonymousRBTs = numAnonymousRBTs2;
 }
Exemplo n.º 9
0
        //    /**
        //     * Constructs a new transliterator from the given rules.
        //     * @param rules rules, separated by ';'
        //     * @param direction either FORWARD or REVERSE.
        //     * @exception IllegalArgumentException if rules are malformed
        //     * or direction is invalid.
        //     */
        //     public RuleBasedTransliterator(String ID, String rules, int direction,
        //                                   UnicodeFilter filter) {
        //        super(ID, filter);
        //        if (direction != FORWARD && direction != REVERSE) {
        //            throw new IllegalArgumentException("Invalid direction");
        //        }
        //
        //        TransliteratorParser parser = new TransliteratorParser();
        //        parser.parse(rules, direction);
        //        if (parser.idBlockVector.size() != 0 ||
        //            parser.compoundFilter != null) {
        //            throw new IllegalArgumentException("::ID blocks illegal in RuleBasedTransliterator constructor");
        //        }
        //
        //        data = (Data)parser.dataVector.get(0);
        //        setMaximumContextLength(data.ruleSet.getMaximumContextLength());
        //     }

        //    /**
        //     * Constructs a new transliterator from the given rules in the
        //     * <code>FORWARD</code> direction.
        //     * @param rules rules, separated by ';'
        //     * @exception IllegalArgumentException if rules are malformed
        //     * or direction is invalid.
        //     */
        //    public RuleBasedTransliterator(String ID, String rules) {
        //        this(ID, rules, FORWARD, null);
        //    }

        internal RuleBasedTransliterator(string ID, Data data, UnicodeFilter filter)
            : base(ID, filter)
        {
            this.data            = data;
            MaximumContextLength = data.RuleSet.MaximumContextLength;
        }