|
MaltParser 1.0.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.maltparser.parser.guide.Guide
public class Guide
The guide is used by a parsing algorithm to predict the next parser action during parsing and to add a instance to the training instance set during learning.
Constructor Summary | |
---|---|
Guide(SingleMaltConfiguration configuration,
ParsingAlgorithm parsingAlgorithm)
Constructs a guide. |
Method Summary | |
---|---|
void |
addInstance(ParserAction parserAction)
Used by the parsing algorithm for adding a instance to the training instance set during learning. |
void |
finalize()
Used for cleaning up the guide models and learner objects. |
void |
finalizeSentence(Sentence sentence,
DependencyGraph dependencyGraph)
Used when a sentence has been processed during learning. |
SingleMaltConfiguration |
getConfiguration()
Returns the current MaltParser configuration object |
File |
getFile(String suffix)
|
InputStreamReader |
getInputStreamReader(String suffix)
|
String |
getModelName()
|
OutputStreamWriter |
getOutputStreamWriter(String suffix)
|
int |
getParserMode()
|
ParsingAlgorithm |
getParsingAlgorithm()
Returns the parsing algorithm |
Class<?> |
getPredictionStrategy()
Returns a prediction strategy object (also know as a guide model) |
void |
initPredictionStrategy()
Initialize prediction strategy (also know as a guide model) |
void |
noMoreInstances()
Used when all training data has been processed during learning. |
boolean |
predict()
Predicts the next parser action during parsing. |
boolean |
predictFromKBestList()
|
void |
setConfiguration(SingleMaltConfiguration configuration)
Sets the current MaltParser configuration object |
void |
setParsingAlgorithm(ParsingAlgorithm parsingAlgorithm)
Sets the parsing algorithm that use the guide to predict the next parser action during parsing and to add a instance during learning. |
String |
toString()
|
void |
updateCardinality()
Updates all the features with latest cardinality (number of distinct values for a particular feature) |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Guide(SingleMaltConfiguration configuration, ParsingAlgorithm parsingAlgorithm) throws MaltChainedException
configuration
- the current MaltParserConfiguration objectparsingAlgorithm
- the parsing algorithm that uses the guide
MaltChainedException
Method Detail |
---|
public void addInstance(ParserAction parserAction) throws MaltChainedException
addInstance
in interface GuideModel
parserAction
- the current parser action.
MaltChainedException
public void finalizeSentence(Sentence sentence, DependencyGraph dependencyGraph) throws MaltChainedException
finalizeSentence
in interface GuideModel
sentence
- the current sentencedependencyGraph
- the current dependency graph
MaltChainedException
public void noMoreInstances() throws MaltChainedException
noMoreInstances
in interface GuideModel
MaltChainedException
public void finalize() throws MaltChainedException
finalize
in interface GuideModel
finalize
in class Object
MaltChainedException
public boolean predict() throws MaltChainedException
predict
in interface GuideModel
MaltChainedException
public boolean predictFromKBestList() throws MaltChainedException
MaltChainedException
public void updateCardinality() throws MaltChainedException
MaltChainedException
public Class<?> getPredictionStrategy()
public void initPredictionStrategy() throws MaltChainedException
MaltChainedException
public ParsingAlgorithm getParsingAlgorithm()
getParsingAlgorithm
in interface GuideModel
public void setParsingAlgorithm(ParsingAlgorithm parsingAlgorithm)
parsingAlgorithm
- the parsing algorithm that use the guidepublic SingleMaltConfiguration getConfiguration()
getConfiguration
in interface GuideModel
public void setConfiguration(SingleMaltConfiguration configuration)
configuration
- the current MaltParser configuration objectpublic String getModelName() throws MaltChainedException
getModelName
in interface GuideModel
MaltChainedException
public OutputStreamWriter getOutputStreamWriter(String suffix) throws MaltChainedException
getOutputStreamWriter
in interface GuideModel
MaltChainedException
public InputStreamReader getInputStreamReader(String suffix) throws MaltChainedException
getInputStreamReader
in interface GuideModel
MaltChainedException
public File getFile(String suffix) throws MaltChainedException
getFile
in interface GuideModel
MaltChainedException
public int getParserMode() throws MaltChainedException
getParserMode
in interface GuideModel
MaltChainedException
public String toString()
toString
in class Object
|
MaltParser 1.0.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |