com.googlecode.whatswrong.io
Class GizaAlignmentFormat

java.lang.Object
  extended by com.googlecode.whatswrong.io.GizaAlignmentFormat
All Implemented Interfaces:
CorpusFormat

public class GizaAlignmentFormat
extends Object
implements CorpusFormat


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.googlecode.whatswrong.io.CorpusFormat
CorpusFormat.Monitor
 
Constructor Summary
GizaAlignmentFormat()
           
 
Method Summary
 JComponent getAccessory()
          Returns the GUI element that controls how this format is to be loaded.
 String getLongName()
          Returns a longer name that may contain information about the configuration of this format.
 String getName()
          Returns the name of this format.
 List<NLPInstance> load(File file, int from, int to)
          Loads a corpus from a file, starting at instance from and ending at instance to (exclusive).
 void loadProperties(Properties properties, String prefix)
          Loads a configuration for this format from the given Properties object.
 void saveProperties(Properties properties, String prefix)
          Saves the configuration of this format to a Properties object.
 void setMonitor(CorpusFormat.Monitor monitor)
          Sets the objects that monitors the progress of this format when loading a file.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GizaAlignmentFormat

public GizaAlignmentFormat()
Method Detail

getAccessory

public JComponent getAccessory()
Description copied from interface: CorpusFormat
Returns the GUI element that controls how this format is to be loaded.

Specified by:
getAccessory in interface CorpusFormat
Returns:
the GUI element that controls how this format is to be loaded.

getLongName

public String getLongName()
Description copied from interface: CorpusFormat
Returns a longer name that may contain information about the configuration of this format.

Specified by:
getLongName in interface CorpusFormat
Returns:
the long name of this format.

getName

public String getName()
Description copied from interface: CorpusFormat
Returns the name of this format.

Specified by:
getName in interface CorpusFormat
Returns:
the name of this format.

load

public List<NLPInstance> load(File file,
                              int from,
                              int to)
                       throws IOException
Description copied from interface: CorpusFormat
Loads a corpus from a file, starting at instance from and ending at instance to (exclusive). This method is required to call CorpusFormat.Monitor.progressed(int) after each instance that was processed.

Specified by:
load in interface CorpusFormat
Parameters:
file - the file to load the corpus from.
from - the starting instance index.
to - the end instance index.
Returns:
a list of NLP instances loaded from the given file in the given interval.
Throws:
IOException - if I/O goes wrong.

loadProperties

public void loadProperties(Properties properties,
                           String prefix)
Description copied from interface: CorpusFormat
Loads a configuration for this format from the given Properties object.

Specified by:
loadProperties in interface CorpusFormat
Parameters:
properties - the Properties object to load from.
prefix - the prefix that properties for this format have in the Properties object.

saveProperties

public void saveProperties(Properties properties,
                           String prefix)
Description copied from interface: CorpusFormat
Saves the configuration of this format to a Properties object.

Specified by:
saveProperties in interface CorpusFormat
Parameters:
properties - the Properties object to store this configuration of this format to.
prefix - the prefix that the properties should have.

setMonitor

public void setMonitor(CorpusFormat.Monitor monitor)
Description copied from interface: CorpusFormat
Sets the objects that monitors the progress of this format when loading a file.

Specified by:
setMonitor in interface CorpusFormat
Parameters:
monitor - the monitor for this format.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.