|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.whatswrong.io.TabFormat
public class TabFormat
A TabFormat loads data from text files where token properties are represented as white-space/tab separated values.
This includes formats such as the CoNLL shared task formats or the MALT-Tab format. This class represents the generic
framework to process such tab separated data. To implement a concrete format clients have to implement the TabProcessor interface.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.googlecode.whatswrong.io.CorpusFormat |
|---|
CorpusFormat.Monitor |
| Constructor Summary | |
|---|---|
TabFormat()
|
|
| Method Summary | |
|---|---|
void |
addProcessor(String name,
TabProcessor processor)
|
void |
addProcessor(TabProcessor processor)
|
static void |
extractSpan00(List<? extends List<String>> rows,
int column,
String type,
NLPInstance instance)
|
static void |
extractSpan03(List<? extends List<String>> rows,
int column,
String type,
NLPInstance instance)
|
static void |
extractSpan05(List<? extends List<String>> rows,
int column,
String type,
String prefix,
NLPInstance instance)
|
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 |
|---|
public TabFormat()
| Method Detail |
|---|
public void addProcessor(String name,
TabProcessor processor)
public void addProcessor(TabProcessor processor)
public String toString()
toString in class Objectpublic String getName()
CorpusFormat
getName in interface CorpusFormatpublic String getLongName()
CorpusFormat
getLongName in interface CorpusFormatpublic JComponent getAccessory()
CorpusFormat
getAccessory in interface CorpusFormatpublic void setMonitor(CorpusFormat.Monitor monitor)
CorpusFormat
setMonitor in interface CorpusFormatmonitor - the monitor for this format.
public void loadProperties(Properties properties,
String prefix)
CorpusFormat
loadProperties in interface CorpusFormatproperties - the Properties object to load from.prefix - the prefix that properties for this format have in the Properties object.
public void saveProperties(Properties properties,
String prefix)
CorpusFormat
saveProperties in interface CorpusFormatproperties - the Properties object to store this configuration of this format to.prefix - the prefix that the properties should have.
public List<NLPInstance> load(File file,
int from,
int to)
throws IOException
CorpusFormatfrom and ending at instance to
(exclusive). This method is required to call CorpusFormat.Monitor.progressed(int)
after each instance that was processed.
load in interface CorpusFormatfile - the file to load the corpus from.from - the starting instance index.to - the end instance index.
IOException - if I/O goes wrong.
public static void extractSpan03(List<? extends List<String>> rows,
int column,
String type,
NLPInstance instance)
public static void extractSpan00(List<? extends List<String>> rows,
int column,
String type,
NLPInstance instance)
public static void extractSpan05(List<? extends List<String>> rows,
int column,
String type,
String prefix,
NLPInstance instance)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||