Ejemplo n.º 1
0
        /// <summary>
        /// Read hyphenation patterns from an <see cref="XmlReader"/>.
        /// </summary>
        /// <param name="source"> <see cref="XmlReader"/> input source for the file </param>
        /// <exception cref="IOException"> In case the parsing fails </exception>
        public virtual void LoadPatterns(XmlReader source)
        {
            PatternParser pp = new PatternParser(this);

            ivalues = new TernaryTree();

            pp.Parse(source);

            // patterns/values should be now in the tree
            // let's optimize a bit
            TrimToSize();
            m_vspace.TrimToSize();
            m_classmap.TrimToSize();

            // get rid of the auxiliary map
            ivalues = null;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Read hyphenation patterns from an XML file.
        /// </summary>
        /// <param name="source"> the InputSource for the file </param>
        /// <exception cref="IOException"> In case the parsing fails </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void loadPatterns(org.xml.sax.InputSource source) throws java.io.IOException
        public virtual void loadPatterns(InputSource source)
        {
            PatternParser pp = new PatternParser(this);

            ivalues = new TernaryTree();

            pp.parse(source);

            // patterns/values should be now in the tree
            // let's optimize a bit
            trimToSize();
            vspace.trimToSize();
            classmap.trimToSize();

            // get rid of the auxiliary map
            ivalues = null;
        }