ch.uzh.ifi.attempto.ape
Class ACEParser

java.lang.Object
  extended by ch.uzh.ifi.attempto.ape.ACEParser
Direct Known Subclasses:
APELocal, APESocket, APEWebservice

public abstract class ACEParser
extends java.lang.Object

This is an interface to the Attempto Parsing Engine (APE), that translates sentences in Attempto Controlled English (ACE) into logic.

Author:
Kaarel Kaljurand, Tobias Kuhn

Constructor Summary
protected ACEParser()
          Creates a new ACEParser object.
 
Method Summary
abstract  ACEParserResult getMultiOutput(java.lang.String text, Lexicon lexicon, OutputType... outputTypes)
          Returns multiple outputs for the given ACE text using the given lexicon.
 ACEParserResult getMultiOutput(java.lang.String text, OutputType... outputTypes)
          Returns multiple outputs for the given ACE text using no lexicon.
abstract  java.lang.String getSoloOutput(java.lang.String text, Lexicon lexicon, OutputType outputType)
          Returns one single output for the given ACE text using the given lexicon.
 java.lang.String getSoloOutput(java.lang.String text, OutputType outputType)
          Returns one single output for the given ACE text using no lexicon.
 java.lang.String getURI()
          Returns the namespace URI to be used for outputs like OWL.
 boolean isClexEnabled()
          Returns whether the built-in lexicon is used.
 boolean isGuessingEnabled()
          Returns whether unknown words should be guessed.
 void setClexEnabled(boolean clexEnabled)
          Determines whether the built-in lexicon should be used.
 void setGuessingEnabled(boolean guessingEnabled)
          Determines whether unknown words should be guessed.
 void setURI(java.lang.String uri)
          Sets the namespace URI to be used for outputs like OWL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ACEParser

protected ACEParser()
Creates a new ACEParser object.

Method Detail

getSoloOutput

public abstract java.lang.String getSoloOutput(java.lang.String text,
                                               Lexicon lexicon,
                                               OutputType outputType)
                                        throws ACEParserException
Returns one single output for the given ACE text using the given lexicon. See the enumeration OutputType for further information about the possible outputs. If parsing succeeds then a string containing the result of the parser is returned. In the case of failure, an ACEParserException is thrown containing the error messages.

Parameters:
text - The ACE text to be parsed.
lexicon - The lexicon to be loaded.
outputType - The kind of output that should be returned.
Returns:
The result as a string.
Throws:
ACEParserException - Contains the error messages if an error occurred.
See Also:
getMultiOutput(String, Lexicon, OutputType...)

getSoloOutput

public final java.lang.String getSoloOutput(java.lang.String text,
                                            OutputType outputType)
                                     throws ACEParserException
Returns one single output for the given ACE text using no lexicon.

Parameters:
text - The ACE text to be parsed.
outputType - The kind of output that should be returned.
Returns:
The result as a string.
Throws:
ACEParserException - Contains the error messages if an error occurred.
See Also:
getSoloOutput(String, Lexicon, OutputType)

getMultiOutput

public abstract ACEParserResult getMultiOutput(java.lang.String text,
                                               Lexicon lexicon,
                                               OutputType... outputTypes)
Returns multiple outputs for the given ACE text using the given lexicon. See the enumeration OutputType for further information about the possible outputs. The result is returned as an ACEParserResult object.

Parameters:
text - The ACE text to be parsed.
lexicon - The lexicon to be loaded.
outputTypes - The kind of outputs that should be returned.
Returns:
A ParserResult object containing the outputs.
See Also:
getSoloOutput(String, Lexicon, OutputType)

getMultiOutput

public final ACEParserResult getMultiOutput(java.lang.String text,
                                            OutputType... outputTypes)
Returns multiple outputs for the given ACE text using no lexicon.

Parameters:
text - The ACE text to be parsed.
outputTypes - The kind of outputs that should be returned.
Returns:
A ParserResult object containing the outputs.
See Also:
getMultiOutput(String, Lexicon, OutputType...)

setGuessingEnabled

public void setGuessingEnabled(boolean guessingEnabled)
Determines whether unknown words should be guessed. If false, unknown words lead to an error message. Note that unknown word guessing is not always perfect. The default value is false.

Parameters:
guessingEnabled - true if unknown words should be guessed. false otherwise.

isGuessingEnabled

public boolean isGuessingEnabled()
Returns whether unknown words should be guessed.

Returns:
true if guessing is enabled.

setURI

public void setURI(java.lang.String uri)
Sets the namespace URI to be used for outputs like OWL.

Parameters:
uri - The namespace URI.

getURI

public java.lang.String getURI()
Returns the namespace URI to be used for outputs like OWL.

Returns:
The namespace URI.

setClexEnabled

public void setClexEnabled(boolean clexEnabled)
Determines whether the built-in lexicon should be used. The default value is true.

Parameters:
clexEnabled - true if the built-in lexicon should be used. false otherwise.

isClexEnabled

public boolean isClexEnabled()
Returns whether the built-in lexicon is used.

Returns:
true if the built-in lexicon is used.


Copyright 2008-2010, Attempto Group, University of Zurich (see http://attempto.ifi.uzh.ch)