textmaven.application.translator
Class LineParser

java.lang.Object
  extended bytextmaven.application.translator.LineParser

public class LineParser
extends java.lang.Object

Parses a WordMagic input file line by line. The parsed line is accessible through the instance state.

Author:
krebtho

Constructor Summary
LineParser(java.io.Reader r)
          If no separator is explicitly set ',' is used as default
LineParser(java.io.Reader r, java.lang.String sep)
           
 
Method Summary
 java.lang.String getChapter()
           
 java.lang.String getDictionary()
           
 java.lang.String getKey()
           
 java.lang.String getLineNo()
           
 java.util.Vector getSentences()
           
 boolean next()
          Parses next line representing an entry to parse.
 void setSeparator(java.lang.String sep)
          Sets separator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineParser

public LineParser(java.io.Reader r)
If no separator is explicitly set ',' is used as default

Parameters:
r - Input reader

LineParser

public LineParser(java.io.Reader r,
                  java.lang.String sep)
Parameters:
r - Input reader
sep - Separator used to separate the various entries
Method Detail

setSeparator

public void setSeparator(java.lang.String sep)
Sets separator.

Parameters:
sep - Separator use separating the various entries

next

public boolean next()
             throws java.io.IOException
Parses next line representing an entry to parse. Before parsing takes place the internal state is reset. After the function returns the entries can be accessed through the provided getters.

Returns:
true if end of reader is reached
Throws:
java.io.IOException

getChapter

public java.lang.String getChapter()
Returns:
chapter section of entry

getKey

public java.lang.String getKey()
Returns:
key section of entry

getLineNo

public java.lang.String getLineNo()
Returns:
line number section of entry

getDictionary

public java.lang.String getDictionary()
Returns:
search algorithm section of entry, null if no algorithm was specified.

getSentences

public java.util.Vector getSentences()
Returns:
sentences section of entry. Each vector element is of type string and represents a sentence


Copyright © 2002-2005 Sourceforge. All Rights Reserved.