public class LanguageFormatterStack
extends java.lang.Object
Constructor and Description |
---|
LanguageFormatterStack() |
Modifier and Type | Method and Description |
---|---|
void |
addToCurrProperties(java.lang.String key,
SumoProcessEntityProperty property)
Add the given key - property pair to the properties of the current stack element.
|
boolean |
areFormulaArgsProcessed()
Are all the formula arguments processed in some way? Note that this method
is called when the relevant args are not held at top of stack, but at top - 1.
|
static boolean |
areFormulaArgsProcessed(StackElement stackElement)
Have all the formula arguments for the given stack element been processed in some way?
|
java.lang.String |
doProcessLevelNatlLanguageGeneration()
Generate natural language from the contents of the top element of the stack.
|
java.lang.String |
doStatementLevelNatlLanguageGeneration()
Top-level method call for informal NLG after all the elements of the formula have been processed.
|
java.util.Map<java.lang.String,SumoProcessCollector> |
getCurrProcessMap()
Return the Map
|
StackElement |
getCurrStackElement()
Return the topmost stack element
|
java.util.List<java.lang.String> |
getCurrStackFormulaArgs()
For the current stack element, iterate through the List
|
static StackElement.FormulaArg |
getFormulaArg(java.util.List<StackElement.FormulaArg> formulaArgs,
java.lang.String theArg)
Read the given list of FormulaArgs for a given argument.
|
VerbProperties.Polarity |
getPolarity()
Getter and setter for polarity field.
|
StackElement |
getPrevStackElement()
Return the stack element that is second from the top
|
void |
insertFormulaArgs(Formula formula)
Insert the given formula arguments into the topmost element of the stack.
|
boolean |
isEmpty()
Is the stack empty?
|
void |
markFormulaArgAsProcessed(java.lang.String theArg)
Mark the given formula argument as having been processed.
|
void |
pop(StackElement inElement)
Pop the top element of the stack if it is inElement.
|
void |
pushCurrSumoProcessDown()
Push the current element's sumoProcessMap down into the previous element.
|
void |
pushCurrTranslatedStateDown(java.lang.String arg)
If the top stack element has been translated, then find the given arg in the previous stack element
and mark the corresponding formula argument as translated.
|
void |
pushNew()
Push a new element onto the stack.
|
void |
pushTranslationDownToNotLevel(java.lang.String statement)
Handle pushing the translation down into the stack for "not" clauses.
|
void |
setCurrTranslatedIfQuantified()
If the curr stack element has just two formula args--the first having a state of QUANTIFIED_VARS, the
second having a state of TRANSLATED--mark the curr stack element as Translated.
|
void |
setPolarity(VerbProperties.Polarity polarity) |
void |
translateCurrProcessInstantiation(KB kb,
Formula formula)
If possible, translate the process instantiation and insert the translation into the topmost
stack element.
|
public VerbProperties.Polarity getPolarity()
public void setPolarity(VerbProperties.Polarity polarity)
public void pop(StackElement inElement)
inElement
- throws IllegalStateException if the topmost element is not inElement, or if the
stack cannot be poppedpublic boolean isEmpty()
public void pushNew()
public StackElement getCurrStackElement()
public StackElement getPrevStackElement()
public java.util.Map<java.lang.String,SumoProcessCollector> getCurrProcessMap()
public void insertFormulaArgs(Formula formula)
formula
- public void markFormulaArgAsProcessed(java.lang.String theArg)
theArg
- public static StackElement.FormulaArg getFormulaArg(java.util.List<StackElement.FormulaArg> formulaArgs, java.lang.String theArg)
formulaArgs
- theArg
- public boolean areFormulaArgsProcessed()
public static boolean areFormulaArgsProcessed(StackElement stackElement)
stackElement
- public java.lang.String doProcessLevelNatlLanguageGeneration()
public java.lang.String doStatementLevelNatlLanguageGeneration()
public void pushCurrTranslatedStateDown(java.lang.String arg)
arg
- public java.util.List<java.lang.String> getCurrStackFormulaArgs()
public void setCurrTranslatedIfQuantified()
public void translateCurrProcessInstantiation(KB kb, Formula formula)
kb
- formula
- a formula for the instantiation of a process, e.g. (instance ?event Classifying)public void pushCurrSumoProcessDown()
public void pushTranslationDownToNotLevel(java.lang.String statement)
statement
- public void addToCurrProperties(java.lang.String key, SumoProcessEntityProperty property)
key
- property
-