|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.uzh.ifi.attempto.ape.ACEParser ch.uzh.ifi.attempto.ape.APELocal
public class APELocal
This class provides an interface to the SWI Prolog executable of the Attempto Parsing Engine (APE). Note that you need the file "ape.exe" (which can be compiled from the Attempto APE distribution) and that SWI Prolog needs to be installed. Furthermore, you have to make sure that the JPL libraries of SWI Prolog are in the java library path. This can be achieved by a Java VM argument which looks like this (for Mac OS X):
-Djava.library.path=/opt/local/lib/swipl-5.6.45/lib/i386-darwin8.10.1
Under Linux, the following environment variable has to be set additionally:
LD_PRELOAD=/usr/lib/pl-5.6.45/lib/i386-linux/libjpl.so
The exact paths are most probably different on your machine. Just look for the directory that
contains the file or symbolic link libjpl.jnilib (under Mac OS X), jpl.dll
(under Windows), or libjpl.so (under Unix). If you get the error message
java.lang.UnsatisfiedLinkError: no jpl in java.library.path
then this is a strong indication that the SWI Prolog JPL libraries are not found.
Constructor Summary | |
---|---|
APELocal(java.lang.String apeExeFile)
Creates a new parser object. |
|
APELocal(java.lang.String prologCommand,
java.lang.String apeExeFile)
Deprecated. |
Method Summary | |
---|---|
void |
addLexicon(Lexicon lexicon)
Loads the lexicon by adding all lexicon entries of the lexicon. |
void |
addLexiconEntry(LexiconEntry lexiconEntry)
Adds a new lexicon entry. |
void |
discardLexicon()
Discards the dynamically added lexicon entries. |
static APELocal |
getInstance()
Returns the singleton APELocal instance. |
ACEParserResult |
getMultiOutput(java.lang.String text,
Lexicon lexicon,
OutputType... outputTypes)
Returns multiple outputs for the given ACE text using the given lexicon. |
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. |
static void |
init(java.lang.String apeExeFile)
Initializes the APELocal singleton instance. |
static void |
init(java.lang.String prologCommand,
java.lang.String apeExeFile)
Deprecated. |
static boolean |
isInitialized()
Checks whether the singleton instance has already been initialized. |
Methods inherited from class ch.uzh.ifi.attempto.ape.ACEParser |
---|
getMultiOutput, getSoloOutput, getURI, isClexEnabled, isGuessingEnabled, setClexEnabled, setGuessingEnabled, setURI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public APELocal(java.lang.String apeExeFile)
apeExeFile
- The path (with filename) of the file "ape.exe".@Deprecated public APELocal(java.lang.String prologCommand, java.lang.String apeExeFile)
prologCommand
argument is actually not needed.
Use APELocal(String)
instead.
prologCommand
- The command to run the SWI Prolog interpreter.
On Windows this is usually "plcon", on Linux "pl", and on Mac "swipl".apeExeFile
- The path (with filename) of the file "ape.exe".Method Detail |
---|
public static APELocal getInstance()
public static void init(java.lang.String apeExeFile)
apeExeFile
- The path (with filename) of the file "ape.exe".@Deprecated public static void init(java.lang.String prologCommand, java.lang.String apeExeFile)
prologCommand
argument is actually not needed.
Use init(String)
instead.
prologCommand
- The command to run the SWI Prolog interpreter.
On Windows this is usually "plcon", on Linux "pl", and on Mac "swipl".apeExeFile
- The path (with filename) of the file "ape.exe".public static boolean isInitialized()
public java.lang.String getSoloOutput(java.lang.String text, Lexicon lexicon, OutputType outputType) throws ACEParserException
ACEParser
getSoloOutput
in class ACEParser
text
- The ACE text to be parsed.lexicon
- The lexicon to be loaded.outputType
- The kind of output that should be returned.
ACEParserException
- Contains the error messages if an error occurred.ACEParser.getMultiOutput(String, Lexicon, OutputType...)
public ACEParserResult getMultiOutput(java.lang.String text, Lexicon lexicon, OutputType... outputTypes)
ACEParser
getMultiOutput
in class ACEParser
text
- The ACE text to be parsed.lexicon
- The lexicon to be loaded.outputTypes
- The kind of outputs that should be returned.
ACEParser.getSoloOutput(String, Lexicon, OutputType)
public void addLexicon(Lexicon lexicon)
lexicon
- The lexicon to be loaded.addLexiconEntry(ch.uzh.ifi.attempto.ape.LexiconEntry)
,
discardLexicon()
public void addLexiconEntry(LexiconEntry lexiconEntry)
lexiconEntry
- The lexicon entry to be added.addLexicon(ch.uzh.ifi.attempto.ape.Lexicon)
,
discardLexicon()
public void discardLexicon()
addLexiconEntry(ch.uzh.ifi.attempto.ape.LexiconEntry)
,
addLexicon(ch.uzh.ifi.attempto.ape.Lexicon)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |