com.aliasi.corpus
Class InputSourceParser<H extends Handler>

java.lang.Object
  extended by com.aliasi.corpus.Parser<H>
      extended by com.aliasi.corpus.InputSourceParser<H>
Type Parameters:
H - the type of handler to which this parser sends events
Direct Known Subclasses:
LineParser, XMLParser

public abstract class InputSourceParser<H extends Handler>
extends Parser<H>

An InputSourceParser is an abstract parser based on an abstract method for parsing from an input source. All parsing methods will eventually call Parser.parse(InputSource).

Since:
LingPipe2.1
Version:
3.0
Author:
Bob Carpenter

Constructor Summary
protected InputSourceParser()
          Construct an input source parser with no specified handler.
protected InputSourceParser(H handler)
          Construct an input source parser with the specified handler.
 
Method Summary
 void parseString(char[] cs, int start, int end)
          Parse the specified character slice.
 
Methods inherited from class com.aliasi.corpus.Parser
getHandler, parse, parse, parse, parseString, setHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputSourceParser

protected InputSourceParser()
Construct an input source parser with no specified handler.


InputSourceParser

protected InputSourceParser(H handler)
Construct an input source parser with the specified handler.

Parameters:
handler - Handler for input events.
Method Detail

parseString

public void parseString(char[] cs,
                        int start,
                        int end)
                 throws IOException
Parse the specified character slice.

This method is implemented by parsing an input source created from a character array reader based on the specified character slice.

Specified by:
parseString in class Parser<H extends Handler>
Parameters:
cs - Underlying charactes for slice.
start - Index of first character in slice.
end - Index of one past the last character in the slice.
Throws:
IOException - If there is an I/O error parsing from the string.
IllegalArgumentException - if the specified indices are out of bounds of the specified character array.