dict.prepare
Class UDDLParser
java.lang.Object
dict.prepare.ParserBase
dict.prepare.UDDLParser
public class UDDLParser
- extends ParserBase
UDDL dictionary file parser.
Used for creating index for text files from the
Universal Dictionary Database http://www.dicts.info/uddl.php.
The following format is assumed:
- the dictionary file is a plain text file encoded in UTF-8
- each translation is located in one line of this text file,
lines are separated by CR, LF or both
- the lines consist of tokens separated by a tab character
- the first token contains one or more keywords, if there are
more than one keywords, the keyword tokens are separated by
whitespaces, semicolons, colons or dots
- Version:
- $Revision: 21 $
- Author:
- Daniel Stoinski
Field Summary |
private static java.lang.String |
INDEX_SEPARATOR
Separates the keyword part from the translation. |
private static java.lang.String |
SEPARATORS
Separates keywors within the index part. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INDEX_SEPARATOR
private static final java.lang.String INDEX_SEPARATOR
- Separates the keyword part from the translation.
- See Also:
- Constant Field Values
SEPARATORS
private static final java.lang.String SEPARATORS
- Separates keywors within the index part.
- See Also:
- Constant Field Values
UDDLParser
public UDDLParser(IDictParserHandler handler)
- Initializes the parser for the given handler.
- Parameters:
handler
- the handler for retrieving extracted index keywords.
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.