예제 #1
0
        // pattern data is in binary format, as described in doc/hyb_file_format.md.
        // Note: the caller is responsible for ensuring that the lifetime of the
        // pattern data is at least as long as the Hyphenator object.

        // Note: nullptr is valid input, in which case the hyphenator only processes
        // soft hyphens.
        public static Hyphenator loadBinary(byte patternData, int minPrefix, int minSuffix)
        {
            Hyphenator result = new Hyphenator();

            result.patternData = patternData;
//C++ TO C# CONVERTER TODO TASK: The following line was determined to be a copy assignment (rather than a reference assignment) - this should be verified and a 'CopyFrom' method should be created:
//ORIGINAL LINE: result->minPrefix = minPrefix;
            result.minPrefix.CopyFrom(minPrefix);
//C++ TO C# CONVERTER TODO TASK: The following line was determined to be a copy assignment (rather than a reference assignment) - this should be verified and a 'CopyFrom' method should be created:
//ORIGINAL LINE: result->minSuffix = minSuffix;
            result.minSuffix.CopyFrom(minSuffix);
            return(result);
        }
예제 #2
0
        public const int kTab_Shift = 29; // keep synchronized with TAB_MASK in StaticLayout.java

        // Note: Locale persists across multiple invocations (it is not cleaned up by
        // finish()), explicitly to avoid the cost of creating ICU BreakIterator
        // objects. It should always be set on the first invocation, but callers are
        // encouraged not to call again unless locale has actually changed. That logic
        // could be here but it's better for performance that it's upstream because of
        // the cost of constructing and comparing the ICU Locale object.
        // Note: caller is responsible for managing lifetime of hyphenator
        public void setLocale(icu.Locale locale, Hyphenator hyphenator)
        {
            mWordBreaker.setLocale(locale);
            mLocale     = locale;
            mHyphenator = hyphenator;
        }