|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object marf.Storage.StorageManager marf.nlp.Parsing.GrammarCompiler.GrammarCompiler marf.nlp.Parsing.GrammarCompiler.ProbabilisticGrammarCompiler
public class ProbabilisticGrammarCompiler
Probabilistic Grammar Compiler processes a grammar enhanced with probability tokens assigned to each production.
$Id: ProbabilisticGrammarCompiler.java,v 1.21 2006/01/30 04:21:57 mokhov Exp $
Field Summary |
---|
Fields inherited from class marf.nlp.Parsing.GrammarCompiler.GrammarCompiler |
---|
oGrammar, oGrammarAnalyzer, oGrammarElement, oRule, oToken, soTransitionTable, strGrammarFileName, TOKEN_ACTION_BREAK, TOKEN_ACTION_CONTINUE, TOKEN_ACTION_PROCEED |
Fields inherited from class marf.Storage.StorageManager |
---|
bDumpOnNotFound, iCurrentDumpMode, oObjectToSerialize, strFilename |
Fields inherited from interface marf.Storage.IStorageManager |
---|
DUMP_BINARY, DUMP_CSV_TEXT, DUMP_GZIP_BINARY, DUMP_HTML, DUMP_SQL, DUMP_XML, MARF_INTERFACE_CODE_REVISION, STORAGE_FILE_EXTENSIONS |
Constructor Summary | |
---|---|
ProbabilisticGrammarCompiler(java.lang.String pstrGrammarFilename)
Constructor with the grammar file filename. |
Method Summary | |
---|---|
protected void |
addNextRHSElement()
Overridden to possibly take into consideration the probability tokens. |
void |
compileGrammar()
Compiles probabilistic grammar. |
protected void |
createEpsilonToken()
Overridden not to create epsilon tokens for probabilistic grammars. |
protected void |
createGrammarAnalyzer()
Instantiates ProbabilisticGrammarAnalyzer with the
current grammar. |
protected void |
createRule()
Overridden to take into account the probability of grammar productions. |
static java.lang.String |
getMARFSourceCodeRevision()
Retrieves class' revision. |
Methods inherited from class marf.nlp.Parsing.GrammarCompiler.GrammarCompiler |
---|
addIDToken, addTerminalToken, checkUndefinedNonTerminals, createEOFTerminal, createNextNonTerminal, getBusted, getGrammar, getGrammarElement, getGrammarFileName, getNextRHSToken, getTransitionTable, loadTT, outputStats, parseGrammar, serialize |
Methods inherited from class marf.Storage.StorageManager |
---|
backSynchronizeObject, clone, dump, dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, equals, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, getObjectToSerialize, hashCode, restore, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ProbabilisticGrammarCompiler(java.lang.String pstrGrammarFilename) throws CompilerError
pstrGrammarFilename
- the filename of the grammar file to use
CompilerError
- if initialization failsMethod Detail |
---|
protected void createGrammarAnalyzer()
ProbabilisticGrammarAnalyzer
with the
current grammar.
createGrammarAnalyzer
in class GrammarCompiler
GrammarCompiler.createGrammarAnalyzer()
,
ProbabilisticGrammarAnalyzer
public void compileGrammar() throws CompilerError
compileGrammar
in class GrammarCompiler
CompilerError
- in case of parsing or lexical mistakesGrammarCompiler.compileGrammar()
protected void createEpsilonToken()
createEpsilonToken
in class GrammarCompiler
GrammarCompiler.createEpsilonToken()
protected void createRule() throws CompilerError
createRule
in class GrammarCompiler
CompilerError
- if a rule operator ::= or a probability are not found, or there
was syntax error while scanning a token in
java.lang.NumberFormatException
- if the probability cannot be parsed as valid doubleGrammarCompiler.createRule()
protected void addNextRHSElement() throws SyntaxError
addNextRHSElement
in class GrammarCompiler
SyntaxError
- if unrecognized token type foundGrammarCompiler.addNextRHSElement()
public static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |