dict.prepare
Class ThesParser

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

public class ThesParser
extends ParserBase

Thesaurus file parser. For thesaurus files from http://www.openthesaurus.de and http://synonimy.ux.pl.


Field Summary
private static java.lang.String CLOSING
          Ignore strings between OPENING and CLOSING.
(package private)  java.lang.StringBuffer m_sb
          Temporary buffer for building index keywords.
private static java.lang.String OPENING
          Ignore strings between OPENING and CLOSING.
private static java.lang.String SEPARATORS
          Characters separating index keywords from eachother.
private static java.lang.String STARTLINE_IGNORE
          Ignore lines starting with these characters.
 
Fields inherited from class dict.prepare.ParserBase
m_handler
 
Constructor Summary
ThesParser(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 thesaurus 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
Ignore strings between OPENING and CLOSING. The have only informational meaning and are no keywords.

See Also:
Constant Field Values

CLOSING

private static final java.lang.String CLOSING
Ignore strings between OPENING and CLOSING. The have only informational meaning and are no keywords.

See Also:
Constant Field Values

SEPARATORS

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

See Also:
Constant Field Values

m_sb

java.lang.StringBuffer m_sb
Temporary buffer for building index keywords.

Constructor Detail

ThesParser

public ThesParser(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 thesaurus file.

Specified by:
processLine in class ParserBase
Parameters:
s - the line string from the thesaurus 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.