|
MaltParser 1.6.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.maltparser.MaltParserService
public class MaltParserService
The purpose of MaltParserService is to easily write third-party programs that uses MaltParser. There are two ways to call the MaltParserService: 1. By running experiments, which allow other programs to train a parser model or parse with a parser model. IO-handling is done by MaltParser. 2. By first initialize a parser model and then call the method parse() with an array of tokens that MaltParser parses. IO-handling of the sentence is done by the third-party program. How to use MaltParserService, please see the examples provided in the directory 'examples/apiexamples/srcex'
| Constructor Summary | |
|---|---|
MaltParserService()
Creates a MaltParserService with the option container 0 |
|
MaltParserService(boolean optionFreeInitialization)
Use this constructor only when you want a MaltParserService without an option manager. |
|
MaltParserService(int optionContainer)
Creates a MaltParserService with the specified option container. |
|
| Method Summary | |
|---|---|
static String |
getMaltJarPath()
Returns the path of malt.jar file |
int |
getOptionContainer()
Returns the option container index |
void |
initializeParserModel(String commandLine)
Initialize a parser model that later can by used to parse sentences. |
DependencyStructure |
parse(String[] tokens)
Parses an array of tokens and returns a dependency structure. |
String[] |
parseTokens(String[] tokens)
Same as parse(String[] tokens), but instead it returns an array of tokens with a head index and a dependency type at the end of string |
DataFormatSpecification |
readDataFormatSpecification(String dataFormatFileName)
Reads the data format specification file |
void |
runExperiment(String commandLine)
Runs a MaltParser experiment. |
void |
terminateParserModel()
Terminates the parser model. |
DependencyStructure |
toDependencyStructure(String[] tokens)
Converts an array of tokens to a dependency structure. |
DependencyStructure |
toDependencyStructure(String[] tokens,
DataFormatSpecification dataFormatSpecification)
Converts an array of tokens to a dependency structure |
DependencyStructure |
toDependencyStructure(String[] tokens,
String dataFormatFileName)
Converts an array of tokens to a dependency structure |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MaltParserService()
throws MaltChainedException
MaltChainedException
public MaltParserService(int optionContainer)
throws MaltChainedException
optionContainer - an integer from 0 to max value of data type Integer
MaltChainedException
public MaltParserService(boolean optionFreeInitialization)
throws MaltChainedException
optionFreeInitialization - true, means that MaltParserService is created without an option manager, false will do the same as MaltParserService().
MaltChainedException| Method Detail |
|---|
public void runExperiment(String commandLine)
throws MaltChainedException
commandLine - a commandLine string that controls the MaltParser.
MaltChainedException
public void initializeParserModel(String commandLine)
throws MaltChainedException
commandLine - a commandLine string that controls the MaltParser
MaltChainedException
public DependencyStructure parse(String[] tokens)
throws MaltChainedException
tokens - an array of tokens
MaltChainedException
public DependencyStructure toDependencyStructure(String[] tokens)
throws MaltChainedException
tokens - an array of tokens
MaltChainedException
public DataFormatSpecification readDataFormatSpecification(String dataFormatFileName)
throws MaltChainedException
dataFormatFileName - the path to the data format specification file
MaltChainedException
public DependencyStructure toDependencyStructure(String[] tokens,
DataFormatSpecification dataFormatSpecification)
throws MaltChainedException
tokens - tokens an array of tokensdataFormatSpecification - a data format specification
MaltChainedException
public DependencyStructure toDependencyStructure(String[] tokens,
String dataFormatFileName)
throws MaltChainedException
tokens - an array of tokensdataFormatFileName - the path to the data format file
MaltChainedException
public String[] parseTokens(String[] tokens)
throws MaltChainedException
tokens - an array of tokens to parse
MaltChainedException
public void terminateParserModel()
throws MaltChainedException
MaltChainedExceptionpublic int getOptionContainer()
public static String getMaltJarPath()
|
MaltParser 1.6.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||