|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
OntologyParser
public class OntologyParser
This class is assisting TQL in the extraction of events. It holds a list of words that are of some importance ("buzzwords"). Such buzzword may have significance when discovered in a cruical position in TQL.
TQL
Field Summary | |
---|---|
java.lang.String[] |
clues
|
java.lang.String |
currClass
|
boolean |
debug_op
|
boolean |
debug_op_2
|
java.io.File |
file
|
OntologyParser |
handler
|
java.util.HashMap<java.lang.String,java.lang.String> |
onto
|
boolean |
subclass
|
Constructor Summary | |
---|---|
OntologyParser()
An ontologyparser without a ontology (yet). |
|
OntologyParser(java.lang.String filepath)
An ontologyparser with a predefined ontology. |
Method Summary | |
---|---|
void |
characters(char[] buf,
int offset,
int len)
The string between tags (usually empty) is processed by this method. |
void |
emit(java.lang.String s)
|
void |
endDocument()
XML-parsing function for end of parsing.\ It has no function but to inform the user of parser completion. |
void |
endElement(java.lang.String namespaceURI,
java.lang.String sName,
java.lang.String qName)
This method completes the action of startElement, namely unsets references that has been set, and adding items to misc lists. |
boolean |
isBuzzAdjective(java.lang.String s)
Wrapper method to mid-levelly check if an adjective has some significance.\ This method is tentative. |
boolean |
isBuzzNoun(java.lang.String s)
Wrapper method to low-levelly check if a word has some significance. |
boolean |
isBuzzVerb(java.lang.String s)
Wrapper method to low-levelly check if a word has some significance. |
boolean |
isBuzzWord(java.lang.String s)
Wrapper method to mid-levelly check if a word has some significance. |
boolean |
isClueWord(java.lang.String s)
Wrapper method to low-levelly check if a word has some significance. |
boolean |
isInOntology(java.lang.String s)
Wrapper method to high-levelly check if a word has some significance. |
boolean |
isOfClass(java.lang.String i,
java.lang.String c)
Checks if a word (noun, verb) is of a certain class in the ontology. |
static void |
main(java.lang.String[] args)
An onologyparser may be started from the command line to verify the correctness of an ontology.\ Thus it has a main-method. |
void |
makeParser(java.lang.String filepath)
Makes a parser, and invokes parsing if there is a defined ontology file. |
java.lang.String |
rmH(java.lang.String s)
This method removes a hash (#) occuring at the start of a string. |
void |
startDocument()
XML-parsing function for start of parsing, but it has no function. |
void |
startElement(java.lang.String namespaceURI,
java.lang.String sName,
java.lang.String qName,
org.xml.sax.Attributes attrs)
Called when the parser find a new starting tag. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.io.File file
public OntologyParser handler
public boolean subclass
public java.lang.String currClass
public java.util.HashMap<java.lang.String,java.lang.String> onto
public boolean debug_op
public boolean debug_op_2
public java.lang.String[] clues
Constructor Detail |
---|
public OntologyParser(java.lang.String filepath)
filepath
- path to the ontology filepublic OntologyParser()
Method Detail |
---|
public static void main(java.lang.String[] args)
public void makeParser(java.lang.String filepath)
filepath
- path to the ontology filepublic boolean isOfClass(java.lang.String i, java.lang.String c)
i
- the noun or verbc
- the class
public boolean isInOntology(java.lang.String s)
s
- the word
isBuzzWord(String)
,
isClueWord(String)
public boolean isBuzzWord(java.lang.String s)
s
- the word
isBuzzNoun(String)
,
isBuzzVerb(String)
public boolean isBuzzAdjective(java.lang.String s)
s
- the word
public boolean isBuzzVerb(java.lang.String s)
s
- the word
public boolean isBuzzNoun(java.lang.String s)
s
- the word
public boolean isClueWord(java.lang.String s)
s
- the word
public void startDocument()
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
public void endDocument()
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
public void startElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
endElement(String, String, String)
public void endElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
startElement(String, String, String, Attributes)
public void characters(char[] buf, int offset, int len) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void emit(java.lang.String s) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public java.lang.String rmH(java.lang.String s)
s
- the string
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |