Package org.nlpub.watset.cli
Class Command
- java.lang.Object
-
- org.nlpub.watset.cli.Command
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
MarkovClusteringOfficialCommand
public abstract class Command extends Object implements Runnable
A generic command of the Watset command-line interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCommand.GlobalParametersGlobal clustering command-line interface parameters.static classCommand.LocalParametersLocal clustering command-line interface parameters.static classCommand.MainParametersWatset command-line interface parameters.
-
Field Summary
Fields Modifier and Type Field Description Command.MainParametersparametersThe main command-line parameters.
-
Constructor Summary
Constructors Constructor Description Command(Command.MainParameters parameters)Create an instance of command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jgrapht.Graph<String,org.jgrapht.graph.DefaultWeightedEdge>getGraph()Read, parse, and return the input graph stored inCommand.MainParameters.input.Stream<String>newInputStream()Provide a stream to the input file.BufferedWriternewOutputWriter()Provide a writer to the output file.
-
-
-
Field Detail
-
parameters
public final Command.MainParameters parameters
The main command-line parameters.
-
-
Constructor Detail
-
Command
public Command(Command.MainParameters parameters)
Create an instance of command.- Parameters:
parameters- the parameters
-
-
Method Detail
-
newInputStream
public Stream<String> newInputStream() throws IOException
Provide a stream to the input file.- Returns:
- the lines from the file as a
Stream - Throws:
IOException- if an I/O error occurs
-
newOutputWriter
public BufferedWriter newOutputWriter() throws IOException
Provide a writer to the output file.- Returns:
- a new buffered writer to write output
- Throws:
IOException- if an I/O error occurs
-
getGraph
public org.jgrapht.Graph<String,org.jgrapht.graph.DefaultWeightedEdge> getGraph()
Read, parse, and return the input graph stored inCommand.MainParameters.input.- Returns:
- a graph
- See Also:
ABCFormat.parse(Stream)
-
-