ABL4J (Alignment Based Learning for Java) - 0.9.7

org.schwiebert.abl4j.io
Class XMLVisitor

java.lang.Object
  extended by org.schwiebert.abl4j.io.XMLVisitor
All Implemented Interfaces:
ISerializationVisitor

public class XMLVisitor
extends Object
implements ISerializationVisitor

Visitor-Implementation that serializes an ITreeBank in (proprietary) XML.

Author:
sschwieb
See Also:
XMLReader, IOFactory

Field Summary
private  Element currentConstituent
           
private  Element currentNtList
           
private  Element currentTree
           
private  Document document
           
private  Element root
           
private  Writer writer
           
 
Constructor Summary
XMLVisitor()
           
 
Method Summary
 void close()
           
 void initialize(Writer writer, Properties properties)
           
 void visitConstituent(IConstituent constituent, boolean begin)
           
 void visitNonTerminal(NonTerminal nonTerminal, boolean hasNext)
           
 void visitSentence(ISentence sentence)
           
 void visitTree(ITree tree, boolean begin)
           
 void visitTreeBank(ITreeBank<?> treebank)
           
 void visitWord(IWord word, boolean hasNext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

private Element root

document

private Document document

writer

private Writer writer

currentTree

private Element currentTree

currentConstituent

private Element currentConstituent

currentNtList

private Element currentNtList
Constructor Detail

XMLVisitor

public XMLVisitor()
Method Detail

close

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

initialize

public void initialize(Writer writer,
                       Properties properties)
                throws IOException
Specified by:
initialize in interface ISerializationVisitor
Throws:
IOException

visitConstituent

public void visitConstituent(IConstituent constituent,
                             boolean begin)
                      throws IOException
Specified by:
visitConstituent in interface ISerializationVisitor
Throws:
IOException

visitNonTerminal

public void visitNonTerminal(NonTerminal nonTerminal,
                             boolean hasNext)
                      throws IOException
Specified by:
visitNonTerminal in interface ISerializationVisitor
Throws:
IOException

visitSentence

public void visitSentence(ISentence sentence)
                   throws IOException
Specified by:
visitSentence in interface ISerializationVisitor
Throws:
IOException

visitTree

public void visitTree(ITree tree,
                      boolean begin)
               throws IOException
Specified by:
visitTree in interface ISerializationVisitor
Throws:
IOException

visitTreeBank

public void visitTreeBank(ITreeBank<?> treebank)
                   throws IOException
Specified by:
visitTreeBank in interface ISerializationVisitor
Throws:
IOException

visitWord

public void visitWord(IWord word,
                      boolean hasNext)
               throws IOException
Specified by:
visitWord in interface ISerializationVisitor
Throws:
IOException

ABL4J (Alignment Based Learning for Java) - 0.9.7

© 2007 Stephan Schwiebert