info.ephyra.nlp.semantics
Class ASSERT

java.lang.Object
  extended by info.ephyra.nlp.semantics.ASSERT

public class ASSERT
extends java.lang.Object

A Wrapper for the ASSERT semantic role labeler.

Version:
2007-04-25
Author:
Andy Schlaikjer, Nico Schlaefer

Field Summary
private static boolean ASSERT_CLIENT_MODE
          Run ASSERT in client mode.
private static java.lang.String ASSERT_DIR
          Directory of ASSERT.
private static java.lang.String CACHE_DIR
          Cache directory where parses are stored.
private static boolean CACHING
          Enable caching of parses.
private static java.util.regex.Pattern PARSE_P
          Pattern for extracting parses from ASSERT's output file.
 
Constructor Summary
ASSERT()
           
 
Method Summary
static java.lang.String[][] annotatePredicates(java.lang.String[] ss)
          Annotates the predicates in an array of sentences.
private static int checkLogFile(java.io.File logf)
          Checks the log file for ASSERT failures.
private static java.io.File createInputFile(java.lang.String[] ss)
          Creates a temporary file containing the sentences to be processed by ASSERT.
private static java.io.File execAssertProcess(java.io.File input)
          Instantiates an ASSERT process using the supplied input file.
private static java.lang.String[][] readOutputFile(java.io.File input, int sentCount)
          Reads the annotated sentences from the output file created by ASSERT.
static java.lang.String untokenize(java.lang.String text, java.lang.String original)
          This untokenizer is tailored for ASSERT.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASSERT_DIR

private static final java.lang.String ASSERT_DIR
Directory of ASSERT.


ASSERT_CLIENT_MODE

private static final boolean ASSERT_CLIENT_MODE
Run ASSERT in client mode.

See Also:
Constant Field Values

CACHING

private static final boolean CACHING
Enable caching of parses.

See Also:
Constant Field Values

CACHE_DIR

private static final java.lang.String CACHE_DIR
Cache directory where parses are stored.

See Also:
Constant Field Values

PARSE_P

private static final java.util.regex.Pattern PARSE_P
Pattern for extracting parses from ASSERT's output file.

Constructor Detail

ASSERT

public ASSERT()
Method Detail

createInputFile

private static java.io.File createInputFile(java.lang.String[] ss)
                                     throws java.lang.Exception
Creates a temporary file containing the sentences to be processed by ASSERT.

Parameters:
ss - sentences to be parsed
Returns:
input file
Throws:
java.lang.Exception

execAssertProcess

private static java.io.File execAssertProcess(java.io.File input)
                                       throws java.lang.Exception
Instantiates an ASSERT process using the supplied input file.

Parameters:
input - an input file initialized previously with a call to createInputFile()
Returns:
log file
Throws:
java.lang.Exception

readOutputFile

private static java.lang.String[][] readOutputFile(java.io.File input,
                                                   int sentCount)
                                            throws java.lang.Exception
Reads the annotated sentences from the output file created by ASSERT.

Parameters:
input - an input file initialized previously with a call to createInputFile()
sentCount - number of sentences that have been passed to ASSERT
Returns:
annotated sentences
Throws:
java.lang.Exception

checkLogFile

private static int checkLogFile(java.io.File logf)
Checks the log file for ASSERT failures. Returns Integer.MAX_VALUE if ASSERT successfully parsed the sentences or the index of the last sentence that was parsed if ASSERT failed. -1 indicates that no sentence could be parsed.

Parameters:
logf - log file
Returns:
Integer.MAX_VALUE or index of last sentence that was parsed

annotatePredicates

public static java.lang.String[][] annotatePredicates(java.lang.String[] ss)
Annotates the predicates in an array of sentences.

Parameters:
ss - sentences to be parsed
Returns:
annotated sentences

untokenize

public static java.lang.String untokenize(java.lang.String text,
                                          java.lang.String original)
This untokenizer is tailored for ASSERT. It does not only remove abundant blanks but it also tries to restore special characters that have been dropped by ASSERT.

Parameters:
text - text to untokenize
original - string that contains the original text as a subsequence
Returns:
subsequence of the original string or null, iff there is no such subsequence