Class TQL

java.lang.Object
  extended by TQL

public class TQL
extends java.lang.Object

This class contains most of the logic for recognising events. It takes care of reading all the lines in a block of statement, and process them according to rules. It constructs an ArrayList of Events, and saves the Events redundantly to the parent abstract.

See Also:
TQLAbstract, OntologyParser

Field Summary
 int block
           
 boolean debug_tql
           
 int eventcounter
           
 java.util.ArrayList<Event> events
           
 int input
           
 java.util.HashMap<java.lang.String,java.lang.String> nouns
           
 OntologyParser op
           
 TQLAbstract parent_abstract
           
 java.util.ArrayList<java.lang.String> statements
           
 
Constructor Summary
TQL(int input, int block, TQLAbstract par, OntologyParser op)
          A TQL represents a block of TQL-statements, and the associated events.
 
Method Summary
 void addLine(java.lang.String line)
          Add a TQL-statement to the list of lines.
 java.lang.String escapeRegEx(java.lang.String s)
          for an abitary string, escape each character that could be misinterpreted in the context of regular expressions
 void extractEvents()
          initiate extraction of events accorting to rules specified in this funciton
 void findEvent()
          initiate extraction of events according to rule
 void findNoun()
          initiate extraction of events according to rule
 void findNREL(Event e)
          check if a sentence contains a noun relation, and possibly add into to already existing event (this method wraps for identifyNREL()
 void findVerb()
          initiate extraction of events according to rule
 java.util.ArrayList getEvents()
          Get an arraylist of the events in this TQL
 java.util.ArrayList getLines()
          Get an arraylist of all statements
 int getNextEvID()
          Get the next available event id number
 void hello()
          A wrapper method for printEvents
 void identifyAdjTheme(Event e)
          check if a sentence contains an adjective that could add data to an event
 void identifyAdjType(Event e)
           
 void identifyEvent(java.lang.String s)
          check if a sentence contains a event definition, and initiate further logic.
 void identifyITVerb(java.lang.String s)
          check if a sentence contains an intrasitive verb, and possibly initiate event
 void identifyNoun(java.lang.String s)
          check if a sentence contains a noun and initiate event logic.
 void identifyNREL(Event e)
          check if a sentence contains a noun relation, and possibly add into to already existing event
 void identifySREL(Event e)
           
 void identifySREL2(Event e, java.lang.String skNum)
           
 void identifyTransVerb(java.lang.String s)
          check if a sentence contains a verb, and initiate event logic.
 void printEvents()
          Echo the events in this TQL to stdout
 java.lang.String prolog(java.lang.String s)
           
 void resolveSkolemns()
          map all skolemns in this TQL to their appropriate class
 java.lang.String sk(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

op

public OntologyParser op

parent_abstract

public TQLAbstract parent_abstract

statements

public java.util.ArrayList<java.lang.String> statements

events

public java.util.ArrayList<Event> events

nouns

public java.util.HashMap<java.lang.String,java.lang.String> nouns

input

public int input

block

public int block

eventcounter

public int eventcounter

debug_tql

public final boolean debug_tql
See Also:
Constant Field Values
Constructor Detail

TQL

public TQL(int input,
           int block,
           TQLAbstract par,
           OntologyParser op)
A TQL represents a block of TQL-statements, and the associated events.

Parameters:
input - the sentence number
block - number of successfully parsed sentences including this one
par - parent abstract
op - the ontologyparser used to determine significance of words
Method Detail

addLine

public void addLine(java.lang.String line)
Add a TQL-statement to the list of lines.

Parameters:
line - the statement to be added

getLines

public java.util.ArrayList getLines()
Get an arraylist of all statements

Returns:
an arraylist of all statements

hello

public void hello()
A wrapper method for printEvents

See Also:
printEvents()

getEvents

public java.util.ArrayList getEvents()
Get an arraylist of the events in this TQL

Returns:
an arraylist of events in this tql

printEvents

public void printEvents()
Echo the events in this TQL to stdout


getNextEvID

public int getNextEvID()
Get the next available event id number

Returns:
event id number

extractEvents

public void extractEvents()
initiate extraction of events accorting to rules specified in this funciton

See Also:
findNoun(), findVerb(), findEvent()

findNoun

public void findNoun()
initiate extraction of events according to rule

See Also:
identifyNoun(String)

findVerb

public void findVerb()
initiate extraction of events according to rule

See Also:
identifyTransVerb(String), identifyITVerb(String)

findEvent

public void findEvent()
initiate extraction of events according to rule

See Also:
identifyEvent(String)

resolveSkolemns

public void resolveSkolemns()
map all skolemns in this TQL to their appropriate class


identifyNoun

public void identifyNoun(java.lang.String s)
check if a sentence contains a noun and initiate event logic. if it matches an event rule, create an event, and find more data on the event

Parameters:
s - the line of tql code
See Also:
findNREL(Event), identifyAdjType(Event)

identifyTransVerb

public void identifyTransVerb(java.lang.String s)
check if a sentence contains a verb, and initiate event logic. if it matches an event rule, create an event, and find more data on the event

Parameters:
s - the line of tql code
See Also:
identifyAdjTheme(Event)

identifyEvent

public void identifyEvent(java.lang.String s)
check if a sentence contains a event definition, and initiate further logic. if it matches an event rule, create an event, and find more data on the event

Parameters:
s - the line of tql code
See Also:
identifySREL2(Event,String)

identifyITVerb

public void identifyITVerb(java.lang.String s)
check if a sentence contains an intrasitive verb, and possibly initiate event

Parameters:
s - the line of tql code
See Also:
identifySREL(Event)

prolog

public java.lang.String prolog(java.lang.String s)

sk

public java.lang.String sk(java.lang.String s)

findNREL

public void findNREL(Event e)
check if a sentence contains a noun relation, and possibly add into to already existing event (this method wraps for identifyNREL()

Parameters:
e - the event to add data to
See Also:
identifyNREL(Event)

identifyNREL

public void identifyNREL(Event e)
check if a sentence contains a noun relation, and possibly add into to already existing event

Parameters:
e - the event to add data to
See Also:
identifyAdjTheme(Event)

identifySREL

public void identifySREL(Event e)

identifySREL2

public void identifySREL2(Event e,
                          java.lang.String skNum)

identifyAdjType

public void identifyAdjType(Event e)

identifyAdjTheme

public void identifyAdjTheme(Event e)
check if a sentence contains an adjective that could add data to an event

Parameters:
e - the event to add data to

escapeRegEx

public java.lang.String escapeRegEx(java.lang.String s)
for an abitary string, escape each character that could be misinterpreted in the context of regular expressions

Parameters:
s - the string to be escaped
Returns:
an escaped string