예제 #1
0
 /// <summary>
 /// Implementation of UnicodeMatcher API. Union the set of all characters
 /// that may be matched by this object into the given set.
 /// </summary>
 ///
 /// <param name="toUnionTo">the set into which to union the source characters</param>
 /// @returns a reference to toUnionTo
 public virtual void AddMatchSetTo(UnicodeSet toUnionTo)
 {
     if (maxCount > 0)
     {
         matcher.AddMatchSetTo(toUnionTo);
     }
 }
예제 #2
0
        /// <summary>
        /// Implementation of UnicodeMatcher API. Union the set of all characters
        /// that may be matched by this object into the given set.
        /// </summary>
        ///
        /// <param name="toUnionTo">the set into which to union the source characters</param>
        public virtual void AddMatchSetTo(UnicodeSet toUnionTo)
        {
            int ch;

            for (int i = 0; i < pattern.Length; i += IBM.ICU.Text.UTF16.GetCharCount(ch))
            {
                ch = IBM.ICU.Text.UTF16.CharAt(pattern, i);
                UnicodeMatcher matcher = data.LookupMatcher(ch);
                if (matcher == null)
                {
                    toUnionTo.Add(ch);
                }
                else
                {
                    matcher.AddMatchSetTo(toUnionTo);
                }
            }
        }
예제 #3
0
        /// <summary>
        /// Union the set of all characters that may be modified by this rule into
        /// the given set.
        /// </summary>
        ///
        internal void AddSourceSetTo(UnicodeSet toUnionTo)
        {
            int limit = anteContextLength + keyLength;

            for (int i = anteContextLength; i < limit;)
            {
                int ch = IBM.ICU.Text.UTF16.CharAt(pattern, i);
                i += IBM.ICU.Text.UTF16.GetCharCount(ch);
                UnicodeMatcher matcher = data.LookupMatcher(ch);
                if (matcher == null)
                {
                    toUnionTo.Add(ch);
                }
                else
                {
                    matcher.AddMatchSetTo(toUnionTo);
                }
            }
        }