public class RuleImporter extends Object
Constructor and Description |
---|
RuleImporter()
Create a rule importer which will read from file
|
RuleImporter(boolean ignoreAutomatas) |
RuleImporter(boolean ignoreAutomatas,
boolean ignoreIncludes) |
RuleImporter(SemanticRulesConfig config)
Create a rule importer which will read from a config object
|
RuleImporter(SemanticRulesConfig config,
boolean ignoreAutomatas) |
RuleImporter(SemanticRulesConfig config,
boolean ignoreAutomatas,
boolean ignoreIncludes) |
Modifier and Type | Method and Description |
---|---|
RuleBase |
importConfig(SemanticRulesConfig.Rulebase ruleBaseConfig) |
List<RuleBase> |
importDir(String ruleBaseDir)
Imports all the rule files (files ending by "sr") in the given directory
|
RuleBase |
importFile(String fileName)
Imports semantic rules from a file
|
RuleBase |
importFile(String fileName,
String automataFile)
Imports semantic rules from a file
|
RuleBase |
importFile(String fileName,
String automataFile,
RuleBase ruleBase)
Imports semantic rules from a file
|
RuleBase |
importFromReader(Reader reader,
String sourceInfo,
String automataFile) |
RuleBase |
importFromReader(Reader reader,
String sourceName,
String automataFile,
RuleBase ruleBase)
Imports rules from a reader
|
RuleBase |
importString(String string,
String automataFile) |
RuleBase |
importString(String string,
String automataFile,
RuleBase ruleBase) |
RuleBase |
importString(String string,
String automataFile,
String sourceName) |
RuleBase |
importString(String string,
String automataFile,
String sourceName,
RuleBase ruleBase) |
void |
include(String ruleBaseName,
RuleBase ruleBase)
Read and include a rule base in another
|
RuleBase |
privateImportConfig(SemanticRulesConfig.Rulebase ruleBaseConfig)
Imports an unitialized rule base
|
RuleBase |
privateImportFile(String fileName,
String automataFile,
RuleBase ruleBase) |
RuleBase |
privateImportFromReader(Reader reader,
String sourceName,
String automataFile,
RuleBase ruleBase)
Returns an unitialized rule base
|
void |
setAutomata(RuleBase base,
String automata) |
public RuleImporter()
public RuleImporter(SemanticRulesConfig config)
public RuleImporter(boolean ignoreAutomatas)
public RuleImporter(boolean ignoreAutomatas, boolean ignoreIncludes)
public RuleImporter(SemanticRulesConfig config, boolean ignoreAutomatas)
public RuleImporter(SemanticRulesConfig config, boolean ignoreAutomatas, boolean ignoreIncludes)
public RuleBase importFile(String fileName) throws IOException, com.yahoo.prelude.semantics.parser.ParseException
fileName
- the rule file to useIOException
- if the file can not be read for some reasoncom.yahoo.prelude.semantics.parser.ParseException
- if the file does not contain a valid semantic rule setpublic RuleBase importFile(String fileName, String automataFile) throws IOException, com.yahoo.prelude.semantics.parser.ParseException
fileName
- the rule file to useautomataFile
- the automata file to use, or null to not use anyIOException
- if the file can not be read for some reasoncom.yahoo.prelude.semantics.parser.ParseException
- if the file does not contain a valid semantic rule setpublic RuleBase importFile(String fileName, String automataFile, RuleBase ruleBase) throws IOException, com.yahoo.prelude.semantics.parser.ParseException
fileName
- the rule file to useautomataFile
- the automata file to use, or null to not use anyruleBase
- an existing rule base to import these rules into, or null
to create a newIOException
- if the file can not be read for some reasoncom.yahoo.prelude.semantics.parser.ParseException
- if the file does not contain a valid semantic rule setpublic RuleBase privateImportFile(String fileName, String automataFile, RuleBase ruleBase) throws IOException, com.yahoo.prelude.semantics.parser.ParseException
IOException
com.yahoo.prelude.semantics.parser.ParseException
public List<RuleBase> importDir(String ruleBaseDir) throws IOException, com.yahoo.prelude.semantics.parser.ParseException
IOException
com.yahoo.prelude.semantics.parser.ParseException
public void include(String ruleBaseName, RuleBase ruleBase) throws IOException, com.yahoo.prelude.semantics.parser.ParseException
IOException
com.yahoo.prelude.semantics.parser.ParseException
public RuleBase importString(String string, String automataFile) throws IOException, com.yahoo.prelude.semantics.parser.ParseException
IOException
com.yahoo.prelude.semantics.parser.ParseException
public RuleBase importString(String string, String automataFile, String sourceName) throws IOException, com.yahoo.prelude.semantics.parser.ParseException
IOException
com.yahoo.prelude.semantics.parser.ParseException
public RuleBase importString(String string, String automataFile, RuleBase ruleBase) throws IOException, com.yahoo.prelude.semantics.parser.ParseException
IOException
com.yahoo.prelude.semantics.parser.ParseException
public RuleBase importString(String string, String automataFile, String sourceName, RuleBase ruleBase) throws IOException, com.yahoo.prelude.semantics.parser.ParseException
IOException
com.yahoo.prelude.semantics.parser.ParseException
public RuleBase importConfig(SemanticRulesConfig.Rulebase ruleBaseConfig) throws IOException, com.yahoo.prelude.semantics.parser.ParseException
IOException
com.yahoo.prelude.semantics.parser.ParseException
public RuleBase privateImportConfig(SemanticRulesConfig.Rulebase ruleBaseConfig) throws IOException, com.yahoo.prelude.semantics.parser.ParseException
IOException
com.yahoo.prelude.semantics.parser.ParseException
public RuleBase importFromReader(Reader reader, String sourceInfo, String automataFile) throws com.yahoo.prelude.semantics.parser.ParseException
com.yahoo.prelude.semantics.parser.ParseException
public RuleBase importFromReader(Reader reader, String sourceName, String automataFile, RuleBase ruleBase) throws com.yahoo.prelude.semantics.parser.ParseException
reader
- the reader containing rules on the proper syntaxsourceName
- a string describing the source of the rules used for error messagesruleBase
- an existing rule base to import the rules into, or null to create a new onecom.yahoo.prelude.semantics.parser.ParseException
- if the reader contains illegal rule syntaxCopyright © 2018. All rights reserved.