ABL4J (Alignment Based Learning for Java) - 0.9.7

org.schwiebert.abl4j.io
Class XmlReader

java.lang.Object
  extended by org.schwiebert.abl4j.io.XmlReader
All Implemented Interfaces:
IConfigurable, ITreebankReader, IXmlDeserializationVisitor

public class XmlReader
extends Object
implements ITreebankReader, IXmlDeserializationVisitor

AblReader-Implementation that deserializes an ITreeBank from (proprietary) XML.

Author:
sschwieb
See Also:
XMLVisitor, IOFactory

Field Summary
private  IConstituent constituent
           
private  ITree currentTree
           
private  Document document
           
private  Reader reader
           
private  Element root
           
private  ITreeBank treebank
           
 
Constructor Summary
XmlReader()
           
 
Method Summary
 void close()
           
 void configure(PropertiesMap pm)
           
 void initialize(InputStream in)
           
 void readTreebank(ITreeBank tb)
           
 void visitConstituent(Element constituent)
           
 void visitNonTerminal(Element nonTerminal)
           
private  void visitScore(Element element)
           
 void visitSentence(Element sentence)
           
 void visitTree(Element tree)
           
 void visitTreeBank(Element treebank)
           
 void visitWord(Element word)
           
private  void walk(Element element)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

document

private Document document

root

private Element root

treebank

private ITreeBank treebank

currentTree

private ITree currentTree

constituent

private IConstituent constituent

reader

private Reader reader
Constructor Detail

XmlReader

public XmlReader()
Method Detail

configure

public void configure(PropertiesMap pm)
               throws InvalidConfigurationException
Specified by:
configure in interface IConfigurable
Throws:
InvalidConfigurationException

readTreebank

public void readTreebank(ITreeBank tb)
                  throws IOException
Specified by:
readTreebank in interface ITreebankReader
Throws:
IOException

walk

private void walk(Element element)
           throws IOException
Throws:
IOException

visitScore

private void visitScore(Element element)

close

public void close()
           throws IOException
Specified by:
close in interface IXmlDeserializationVisitor
Throws:
IOException

initialize

public void initialize(InputStream in)
                throws IOException
Specified by:
initialize in interface IXmlDeserializationVisitor
Throws:
IOException

visitConstituent

public void visitConstituent(Element constituent)
                      throws IOException
Specified by:
visitConstituent in interface IXmlDeserializationVisitor
Throws:
IOException

visitNonTerminal

public void visitNonTerminal(Element nonTerminal)
                      throws IOException
Specified by:
visitNonTerminal in interface IXmlDeserializationVisitor
Throws:
IOException

visitSentence

public void visitSentence(Element sentence)
                   throws IOException
Specified by:
visitSentence in interface IXmlDeserializationVisitor
Throws:
IOException

visitTree

public void visitTree(Element tree)
               throws IOException
Specified by:
visitTree in interface IXmlDeserializationVisitor
Throws:
IOException

visitTreeBank

public void visitTreeBank(Element treebank)
                   throws IOException
Specified by:
visitTreeBank in interface IXmlDeserializationVisitor
Throws:
IOException

visitWord

public void visitWord(Element word)
               throws IOException
Specified by:
visitWord in interface IXmlDeserializationVisitor
Throws:
IOException

ABL4J (Alignment Based Learning for Java) - 0.9.7

© 2007 Stephan Schwiebert