|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecthyspirit.engines.HyEngine
hyspirit.engines.HyAnalysisEngine
hyspirit.engines.HyText2POOLEngine
public class HyText2POOLEngine
| Field Summary |
|---|
| Fields inherited from class hyspirit.engines.HyAnalysisEngine |
|---|
filenames |
| Fields inherited from class hyspirit.engines.HyEngine |
|---|
argumentString, LOG, stdin, TIME_PREFIX |
| Constructor Summary | |
|---|---|
HyText2POOLEngine()
This constructor tries to determine the HySpirit environment automatically |
|
HyText2POOLEngine(HySpiritProperties hyspirit)
This constructor must be used if you are going to start your own engine process (client/server mode). |
|
| Method Summary | |
|---|---|
void |
addMorpheme(java.lang.String morpheme)
Delare a word as a morpheme, i.e. exclude it from stemming. |
void |
addMorphemeFile(java.lang.String filename)
Add a file containing morphemes. |
void |
addStemRulesFile(java.lang.String filename)
Adds a file that contains stemming rules. |
void |
addStopword(java.lang.String stopword)
Delare a word as a stopword. |
void |
addStopwordFile(java.lang.String filename)
Add a file containing stopword. |
void |
addTextFile(java.lang.String filename)
|
protected java.lang.String[] |
buildCommand()
Builds the command from the parameters. |
void |
cwa(boolean cwa)
Sets open world assumption (cwa = false) or closed world assumption (cwa = true). |
java.lang.String |
echoSpecial(java.lang.String message)
Returns a string which lets the engine echo the given message |
protected java.lang.String |
getStreamEndMessage()
Returns the stream end message. |
void |
maxStringLength(int maxStringLength)
Sets the maximum string length. |
void |
maxWordLength(int maxWordLength)
Sets the maximum word length. |
void |
minStringLength(int minStringLength)
Sets the minimum string length. |
void |
minWordLength(int minWordLength)
Sets the minimum word length. |
void |
negationRegex(java.lang.String negationRegex)
The regular expression for negation recognition. |
void |
numberOfTrigrams(int numberOfTrigrams)
The number of troigrams to be generated. |
void |
numberRegex(java.lang.String numberRegex)
The regular expression for number recognition. |
void |
parseNegation(boolean negation)
Whether to interpret the word "not" or not. |
void |
recogniseClassifications(boolean classifications)
Whether to recognise classifications or not. |
void |
recogniseNumbers(boolean numbers)
Whether to recognise numbers or not. |
void |
recogniseRelationships(boolean relationships)
Whether to recognise relationships or not. |
void |
recogniseStrings(boolean strings)
Whether to recognise strings or not. |
void |
reset()
Resets all parameters of the engine after destroying a possibly running process. |
void |
skip(java.lang.String skipRegex)
Skip signs and words matching the given regular expression. |
void |
stemming(boolean stemming)
Whether stemming should be applied or not. |
void |
stringRegex(java.lang.String stringRegex)
The regular expression for string recognition. |
void |
translateUmlauts(boolean umlauts)
Whether to translate umlauts to aeoeue. |
void |
wordRegex(java.lang.String wordRegex)
The regular expression for word recognition. |
void |
wordSep(java.lang.String wordSep)
Regular expression of word separators. |
| Methods inherited from class hyspirit.engines.HyAnalysisEngine |
|---|
addFile, context, context, runAndWait |
| Methods inherited from class hyspirit.engines.HyEngine |
|---|
closeSTDIN, destroy, exitValue, getCommand, getEngineName, getInputReader, getOutputWriter, getPercentageCPU, getRealTime, getSTDERR, getSTDIN, getSTDOUT, getSysTime, getUserTime, hasNext, isInClientMode, isRunning, kb, kb, kb, next, readFromSTDIN, restart, run, send, send, sendAndReceive, sendFile, setArgumentString, setLogger, start, suppressSTDERR, takesTime, takeTime, waitFor, waitTillRunning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HyText2POOLEngine()
throws HySpiritException
HySpiritException - if the HySiprit environment cannot be
determined
public HyText2POOLEngine(HySpiritProperties hyspirit)
throws HySpiritException
hyspirit - the HySpirit properties containing the environment
HySpiritException - if we can't determine the environment| Method Detail |
|---|
protected java.lang.String getStreamEndMessage()
getStreamEndMessage in class HyEnginepublic java.lang.String echoSpecial(java.lang.String message)
echoSpecial in class HyEnginemessage - the message to be echoed
public void stemming(boolean stemming)
stemming - ue if stemming should be applied, false if notpublic void addStemRulesFile(java.lang.String filename)
filename - the name of the file containing stemming rulespublic void addMorpheme(java.lang.String morpheme)
morpheme - the word to be excluded from stemmingpublic void addMorphemeFile(java.lang.String filename)
filename - public void addStopword(java.lang.String stopword)
stopword - the word to be excluded from stemmingpublic void addStopwordFile(java.lang.String filename)
filename - public void translateUmlauts(boolean umlauts)
umlauts - - flag for using umlautspublic void numberOfTrigrams(int numberOfTrigrams)
numberOfTrigrams - public void parseNegation(boolean negation)
negation - public void cwa(boolean cwa)
cwa - flag if closed or open world assumptionpublic void recogniseStrings(boolean strings)
strings - public void recogniseNumbers(boolean numbers)
numbers - public void recogniseClassifications(boolean classifications)
classifications - public void recogniseRelationships(boolean relationships)
relationships - true if relationships should be recognisedpublic void wordSep(java.lang.String wordSep)
wordSep - public void skip(java.lang.String skipRegex)
skipRegex - the regular expression of words and signs to skippublic void minStringLength(int minStringLength)
minStringLength - public void maxStringLength(int maxStringLength)
maxStringLength - public void minWordLength(int minWordLength)
minWordLength - public void maxWordLength(int maxWordLength)
maxWordLength - public void wordRegex(java.lang.String wordRegex)
wordRegex - public void numberRegex(java.lang.String numberRegex)
numberRegex - public void stringRegex(java.lang.String stringRegex)
stringRegex - public void negationRegex(java.lang.String negationRegex)
negationRegex - public void addTextFile(java.lang.String filename)
public void reset()
run().
reset in class HyEngineprotected java.lang.String[] buildCommand()
HyAnalysisEnginebuildCommand and
reset methods and also ensure that filenames are included.
You can use the following code for this:
for (Enumeration e = super.filenames.elements(); e.hasMoreElements();)
{
commandVec.add((String)e.nextElement());
}
Be sure that you also place the support for new,
additional parameters somewhere. This means the block
if (this.argumentString != null) {
StringTokenizer strTok= new StringTokenizer(this.argumentString);
while (strTok.hasMoreTokens()) commandVec.add(strTok.nextToken());
}
should appear somewhere in your buildCommand
implementation.
The output of this method is used in the run() method.
buildCommand in class HyAnalysisEngine
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||