|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.cs.ai.kreator.scripting.KreatorScriptEngine
public class KreatorScriptEngine
The Class KreatorScriptEngine manages a JavaScript-Engine.
Nested Class Summary | |
---|---|
class |
KreatorScriptEngine.ScriptWorker
The Class ScriptWorker. |
Field Summary | |
---|---|
static java.lang.String |
END_OF_COMMAND_LINE
Represents the delimiter of two commands. |
static java.lang.String |
LINE_COMMENT_START
Starts a single line comment |
static org.apache.log4j.Logger |
LOG
The Constant LOG. |
Constructor Summary | |
---|---|
KreatorScriptEngine(ConsolePane consolePane)
Instantiates a new kreatorScriptEngine. |
Method Summary | |
---|---|
static java.lang.String |
composeGenerateDataCommand(java.io.File inputFile,
java.io.File outputFile,
int number,
boolean overwriteExisting,
boolean addToProject,
boolean openfile)
|
static java.lang.String |
composeLearnParameterCommand(java.io.File sampleFile,
java.io.File knowledgebase,
ParameterLearner learner,
java.io.File outputFile,
KnowledgebaseWriter writer,
boolean doNotOverwriteExisting,
boolean doNotAddToProject,
boolean doNotOpenfile)
Builds a string representing the learnparameter command in appropriate JavaScript syntax. |
static java.lang.String |
composeLearnStructureAndParameterCommand(java.io.File sampleFile,
StructureLearner slearner,
ParameterLearner plearner,
java.io.File outputFile,
KnowledgebaseWriter writer,
boolean doNotOverwriteExisting,
boolean doNotAddToProject,
boolean doNotOpenfile)
Builds a string representing the combined learn command (structure and parameter) in appropriate JavaScript syntax. |
static java.lang.String |
composeLearnStructureCommand(java.io.File sampleFile,
StructureLearner learner,
java.io.File outputFile,
KnowledgebaseWriter writer,
boolean doNotOverwriteExisting,
boolean doNotAddToProject,
boolean doNotOpenfile)
Builds a string representing the learnstructure command in appropriate JavaScript syntax. |
static java.lang.String |
composeQueryCommand(java.io.File kbaseFile,
java.lang.String query)
Returns a string representing the query command in appropriate JavaScript syntax. |
static java.lang.String |
composeQueryCommand(java.io.File kbaseFile,
java.lang.String query,
java.util.List<java.io.File> evidenceFiles)
Returns a string representing the query command in appropriate JavaScript syntax. |
static java.lang.String |
constructPath(java.io.File file)
Constructs an absolute or relative (to the present working directory) pathname from a file, depending on the configuration option GENERAL__REPORT_ABSOLUTE_PATH. |
protected void |
done()
Can be overloaded by utilizing classes to execute code after successful execution of scripts |
void |
executeScript(java.lang.String script)
Executes a KreatorScript (and prints the result of the last evaluated script line to the console). |
void |
executeScript(java.lang.String script,
boolean printResult)
Executes a KreatorScript. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.log4j.Logger LOG
public static final java.lang.String END_OF_COMMAND_LINE
public static final java.lang.String LINE_COMMENT_START
Constructor Detail |
---|
public KreatorScriptEngine(ConsolePane consolePane)
consolePane
- the consolePaneMethod Detail |
---|
public void executeScript(java.lang.String script, boolean printResult)
script
- the KreatorScriptprintResult
- If true
, the result of the last evaluated script
line is printed to the console (usually the case if an
interactively typed single script command is executed).
If false
, the last result is not printed (usually
the case if a "full" script (i.e. a script file) is executed.).public void executeScript(java.lang.String script)
script
- the KreatorScriptprotected void done()
public static java.lang.String composeQueryCommand(java.io.File kbaseFile, java.lang.String query, java.util.List<java.io.File> evidenceFiles)
knowledgebase
- query
- evidenceFiles
-
public static java.lang.String composeQueryCommand(java.io.File kbaseFile, java.lang.String query)
kbaseFile
- query
-
public static java.lang.String composeLearnStructureCommand(java.io.File sampleFile, StructureLearner learner, java.io.File outputFile, KnowledgebaseWriter writer, boolean doNotOverwriteExisting, boolean doNotAddToProject, boolean doNotOpenfile)
sampleFile
- the file with the samples for learning.learner
- referencee to the used structure learner.outputFile
- file handle for the output file.writer
- reference to the used Writer for translating the knowledgebase into a file.doNotOverwriteExisting
- doNotAddToProject
- doNotOpenfile
-
public static java.lang.String composeLearnParameterCommand(java.io.File sampleFile, java.io.File knowledgebase, ParameterLearner learner, java.io.File outputFile, KnowledgebaseWriter writer, boolean doNotOverwriteExisting, boolean doNotAddToProject, boolean doNotOpenfile)
sampleFile
- the file with the samples for learningknowledgebase
- reference to a knowledgebase with structural information.learner
- reference to th euser parameter learner instance.outputFile
- file handle of the output file.writer
- reference to the used Writer for translating the Knowledgebase into a file.doNotOverwriteExisting
- doNotAddToProject
- doNotOpenfile
-
public static java.lang.String composeLearnStructureAndParameterCommand(java.io.File sampleFile, StructureLearner slearner, ParameterLearner plearner, java.io.File outputFile, KnowledgebaseWriter writer, boolean doNotOverwriteExisting, boolean doNotAddToProject, boolean doNotOpenfile)
sampleFile
- the file with the samples for learningslearner
- reference to an instance of the used structure learner.plearner
- reference to an instance of the used parameter learner.outputFile
- file handle of the output file.writer
- reference to the used Writer for translating the Knowledgebase into a file.doNotOverwriteExisting
- doNotAddToProject
- doNotOpenfile
-
public static java.lang.String composeGenerateDataCommand(java.io.File inputFile, java.io.File outputFile, int number, boolean overwriteExisting, boolean addToProject, boolean openfile)
public static java.lang.String constructPath(java.io.File file)
file
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |