Class PatternParser
A XMLReader document handler to read and parse hyphenation patterns from a XML file.
LUCENENET: This class has been refactored from its Java counterpart to use XmlReader rather than a SAX parser.Inherited Members
Namespace: Lucene.Net.Analysis.Compound.Hyphenation
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public class PatternParser
Constructors
PatternParser()
A XMLReader document handler to read and parse hyphenation patterns from a XML file.
LUCENENET: This class has been refactored from its Java counterpart to use XmlReader rather than a SAX parser.Declaration
public PatternParser()
PatternParser(IPatternConsumer)
A XMLReader document handler to read and parse hyphenation patterns from a XML file.
LUCENENET: This class has been refactored from its Java counterpart to use XmlReader rather than a SAX parser.Declaration
public PatternParser(IPatternConsumer consumer)
Parameters
Type | Name | Description |
---|---|---|
IPatternConsumer | consumer |
Properties
Consumer
A XMLReader document handler to read and parse hyphenation patterns from a XML file.
LUCENENET: This class has been refactored from its Java counterpart to use XmlReader rather than a SAX parser.Declaration
public virtual IPatternConsumer Consumer { get; set; }
Property Value
Type | Description |
---|---|
IPatternConsumer |
Methods
Characters(char[], int, int)
Receive notification of character data.
The Parser will call this method to report each chunk of character data. Parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information. The application must not attempt to read from the array outside of the specified range.Declaration
public virtual void Characters(char[] ch, int start, int length)
Parameters
Type | Name | Description |
---|---|---|
char[] | ch | |
int | start | |
int | length |
EndElement(string, string, string)
Receive notification of the end of an element.
The parser will invoke this method at the end of every element in the XML document; there will be a corresponding StartElement(string, string, string, IDictionary<string, string>) event for every EndElement(string, string, string) event (even when the element is empty).Declaration
public virtual void EndElement(string uri, string local, string raw)
Parameters
Type | Name | Description |
---|---|---|
string | uri | the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed |
string | local | the local name (without prefix), or the empty string if Namespace processing is not being performed |
string | raw |
GetExceptionWord<T1>(IList<T1>)
A XMLReader document handler to read and parse hyphenation patterns from a XML file.
LUCENENET: This class has been refactored from its Java counterpart to use XmlReader rather than a SAX parser.Declaration
protected virtual string GetExceptionWord<T1>(IList<T1> ex)
Parameters
Type | Name | Description |
---|---|---|
IList<T1> | ex |
Returns
Type | Description |
---|---|
string |
Type Parameters
Name | Description |
---|---|
T1 |
GetInterletterValues(string)
A XMLReader document handler to read and parse hyphenation patterns from a XML file.
LUCENENET: This class has been refactored from its Java counterpart to use XmlReader rather than a SAX parser.Declaration
protected static string GetInterletterValues(string pat)
Parameters
Type | Name | Description |
---|---|---|
string | pat |
Returns
Type | Description |
---|---|
string |
GetPattern(string)
A XMLReader document handler to read and parse hyphenation patterns from a XML file.
LUCENENET: This class has been refactored from its Java counterpart to use XmlReader rather than a SAX parser.Declaration
protected static string GetPattern(string word)
Parameters
Type | Name | Description |
---|---|---|
string | word |
Returns
Type | Description |
---|---|
string |
NormalizeException<T1>(IList<T1>)
A XMLReader document handler to read and parse hyphenation patterns from a XML file.
LUCENENET: This class has been refactored from its Java counterpart to use XmlReader rather than a SAX parser.Declaration
protected virtual IList<object> NormalizeException<T1>(IList<T1> ex)
Parameters
Type | Name | Description |
---|---|---|
IList<T1> | ex |
Returns
Type | Description |
---|---|
IList<object> |
Type Parameters
Name | Description |
---|---|
T1 |
Parse(FileInfo)
Parses a hyphenation pattern file.
Declaration
public virtual void Parse(FileInfo file)
Parameters
Type | Name | Description |
---|---|---|
FileInfo | file | a FileInfo object representing the file |
Exceptions
Type | Condition |
---|---|
IOException | In case of an exception while parsing |
Parse(FileInfo, Encoding)
Parses a hyphenation pattern file.
Declaration
public virtual void Parse(FileInfo file, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
FileInfo | file | a FileInfo object representing the file |
Encoding | encoding | The character encoding to use |
Exceptions
Type | Condition |
---|---|
IOException | In case of an exception while parsing |
Parse(Stream)
Parses a hyphenation pattern file.
Declaration
public virtual void Parse(Stream xmlStream)
Parameters
Type | Name | Description |
---|---|---|
Stream | xmlStream | The stream containing the XML data. The PatternParser scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters. |
Exceptions
Type | Condition |
---|---|
IOException | In case of an exception while parsing |
Parse(string)
Parses a hyphenation pattern file.
Declaration
public virtual void Parse(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The complete file path to be read. |
Exceptions
Type | Condition |
---|---|
IOException | In case of an exception while parsing |
Parse(string, Encoding)
Parses a hyphenation pattern file.
Declaration
public virtual void Parse(string path, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
string | path | The complete file path to be read. |
Encoding | encoding | The character encoding to use |
Exceptions
Type | Condition |
---|---|
IOException | In case of an exception while parsing |
Parse(XmlReader)
Parses a hyphenation pattern file.
Declaration
public virtual void Parse(XmlReader source)
Parameters
Type | Name | Description |
---|---|---|
XmlReader | source | XmlReader input source for the file |
Exceptions
Type | Condition |
---|---|
IOException | In case of an exception while parsing |
ReadToken(StringBuilder)
A XMLReader document handler to read and parse hyphenation patterns from a XML file.
LUCENENET: This class has been refactored from its Java counterpart to use XmlReader rather than a SAX parser.Declaration
protected virtual string ReadToken(StringBuilder chars)
Parameters
Type | Name | Description |
---|---|---|
StringBuilder | chars |
Returns
Type | Description |
---|---|
string |
StartElement(string, string, string, IDictionary<string, string>)
Receive notification of the beginning of an element.
The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding EndElement(string, string, string) event for every StartElement(string, string, string, IDictionary<string, string>) event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement event.Declaration
public virtual void StartElement(string uri, string local, string raw, IDictionary<string, string> attrs)
Parameters
Type | Name | Description |
---|---|---|
string | uri | the Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed |
string | local | the local name (without prefix), or the empty string if Namespace processing is not being performed |
string | raw | |
IDictionary<string, string> | attrs | the attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined |