|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.templateparser.ParseResults
Contains the attributes and behavior of the results of a template parse.
Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.
THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Field Summary | |
protected java.util.ArrayList |
bindings
Variables and their bound text as an list of string pairs. |
protected java.lang.String |
inputText
input text |
protected java.util.ArrayList |
inputWords
input words |
boolean |
isCompleteParse
Indicates whether the complete input text was parsed. |
protected Performative |
performative
Performative from the template if parsed OK, otherwise set to the not-understood performative. |
protected Template |
template
template used for the parse |
protected java.lang.String |
terminalPunctuation
Input text terminal punctuation, which defaults to none. |
Constructor Summary | |
ParseResults(java.lang.String inputText)
Constructs a new ParseResults object given the text for parsing. |
Method Summary | |
void |
addBinding(CycVariable templateVariable,
java.util.ArrayList textBinding)
Adds a template variable and its text binding to the list of bindings. |
java.util.ArrayList |
getBindings()
Returns the list of bindings. |
java.lang.String |
getInputText()
Returns the input text |
java.util.ArrayList |
getInputWords()
Returns the input words. |
Performative |
getPerformative()
Returns the Performative. |
Template |
getTemplate()
Returns the template used for the parse. |
java.lang.String |
getTerminalPunctuation()
Returns the terminalPunctuation. |
java.util.ArrayList |
getTextBinding(CycVariable templateVariable)
Returns the text binding for the given template variable. |
void |
setInputWords(java.util.ArrayList inputWords)
Sets the input words. |
void |
setPerformative(Performative performative)
Sets the Performative to the given value. |
void |
setTemplate(Template template)
Sets the template used for the parse. |
void |
setTerminalPunctuation(java.lang.String terminalPunctuation)
Sets the terminalPunctuation. |
java.lang.String |
toString()
Returns the string representation of the ParseResults |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String inputText
protected java.util.ArrayList inputWords
protected Template template
protected Performative performative
protected java.lang.String terminalPunctuation
protected java.util.ArrayList bindings
public boolean isCompleteParse
Constructor Detail |
public ParseResults(java.lang.String inputText)
inputText
- the input text for parsingMethod Detail |
public java.lang.String getInputText()
public void setInputWords(java.util.ArrayList inputWords)
inputWords
- the input wordspublic java.util.ArrayList getInputWords()
public void setTerminalPunctuation(java.lang.String terminalPunctuation)
terminalPunctuation
- the last punctuation character
in the input text.public java.lang.String getTerminalPunctuation()
public void setTemplate(Template template)
template
- the template used for the parsepublic Template getTemplate()
the
- template used for the parsepublic void setPerformative(Performative performative)
performative
- the performativepublic Performative getPerformative()
public void addBinding(CycVariable templateVariable, java.util.ArrayList textBinding)
templateVariable
- the template variabletextBinding
- the portion of the input text bound to the given
template variablepublic java.util.ArrayList getBindings()
public java.util.ArrayList getTextBinding(CycVariable templateVariable)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |