Lucene.Net.Analysis.Compound.HyphenationCompoundWordTokenFilter.GetHyphenationTree C# (CSharp) Method

GetHyphenationTree() public static method

Create a hyphenator tree
If there is a low-level I/O error.
public static GetHyphenationTree ( FileInfo hyphenationFile ) : HyphenationTree
hyphenationFile System.IO.FileInfo the file of the XML grammar to load
return org.apache.lucene.analysis.compound.hyphenation.HyphenationTree
        public static HyphenationTree GetHyphenationTree(FileInfo hyphenationFile)
        {
            return GetHyphenationTree(hyphenationFile, Encoding.UTF8);
        }

Same methods

HyphenationCompoundWordTokenFilter::GetHyphenationTree ( FileInfo hyphenationFile, Encoding encoding ) : HyphenationTree
HyphenationCompoundWordTokenFilter::GetHyphenationTree ( Stream hyphenationSource ) : HyphenationTree
HyphenationCompoundWordTokenFilter::GetHyphenationTree ( Stream hyphenationSource, Encoding encoding ) : HyphenationTree
HyphenationCompoundWordTokenFilter::GetHyphenationTree ( string hyphenationFilename ) : HyphenationTree
HyphenationCompoundWordTokenFilter::GetHyphenationTree ( string hyphenationFilename, Encoding encoding ) : HyphenationTree

Usage Example

Exemplo n.º 1
0
        public virtual void Inform(IResourceLoader loader)
        {
            Stream stream = null;

            try
            {
                if (dictFile != null) // the dictionary can be empty.
                {
                    dictionary = GetWordSet(loader, dictFile, false);
                }
                // TODO: Broken, because we cannot resolve real system id
                // ResourceLoader should also supply method like ClassLoader to get resource URL
                stream = loader.OpenResource(hypFile);
                //InputSource @is = new InputSource(stream);
                //@is.Encoding = encoding; // if it's null let xml parser decide
                //@is.SystemId = hypFile;

                var xmlEncoding = string.IsNullOrEmpty(encoding) ? Encoding.UTF8 : Encoding.GetEncoding(encoding);

                hyphenator = HyphenationCompoundWordTokenFilter.GetHyphenationTree(stream, xmlEncoding);
            }
            finally
            {
                IOUtils.CloseWhileHandlingException(stream);
            }
        }
All Usage Examples Of Lucene.Net.Analysis.Compound.HyphenationCompoundWordTokenFilter::GetHyphenationTree