dict.prepare
Class DictParser

java.lang.Object
  extended by dict.prepare.ParserBase
      extended by dict.prepare.DictParser

public class DictParser
extends ParserBase

Dict.cc dictionary file parser.


Field Summary
private static java.lang.String CLOSING
          Characters closing strings to ignore while parsing for index.
private static java.lang.String INDEX_SEPARATOR
          Strings separating index from the explanation.
private static java.lang.String OPENING
          Characters opening strings to ignore while parsing for index.
private static java.lang.String SEPARATORS
          Characters separating index keywords from each other.
private static java.lang.String STARTLINE_IGNORE
          Ignore lines starting with these characters.
 
Fields inherited from class dict.prepare.ParserBase
m_handler
 
Constructor Summary
DictParser(IDictParserHandler handler)
          Initializes the parser for the given handler.
 
Method Summary
protected  boolean processLine(java.lang.String s, int fileno, long from, long to)
          Extracts index keywords from one line of the dictionary file.
 
Methods inherited from class dict.prepare.ParserBase
getInstance, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STARTLINE_IGNORE

private static final java.lang.String STARTLINE_IGNORE
Ignore lines starting with these characters.

See Also:
Constant Field Values

OPENING

private static final java.lang.String OPENING
Characters opening strings to ignore while parsing for index.

See Also:
Constant Field Values

CLOSING

private static final java.lang.String CLOSING
Characters closing strings to ignore while parsing for index.

See Also:
Constant Field Values

INDEX_SEPARATOR

private static final java.lang.String INDEX_SEPARATOR
Strings separating index from the explanation.

See Also:
Constant Field Values

SEPARATORS

private static final java.lang.String SEPARATORS
Characters separating index keywords from each other.

See Also:
Constant Field Values
Constructor Detail

DictParser

public DictParser(IDictParserHandler handler)
Initializes the parser for the given handler.

Parameters:
handler - the handler for retrieving extracted index keywords.
Method Detail

processLine

protected boolean processLine(java.lang.String s,
                              int fileno,
                              long from,
                              long to)
Extracts index keywords from one line of the dictionary file.

Specified by:
processLine in class ParserBase
Parameters:
s - the line string from the dictionary file.
from - position of the line begin in the file.
to - position of the line end in the file.
fileno - index of the dictionary file, from which line s has been extracted.
Returns:
true, if the parsing process should continue, false if it has been interrupted.