|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.bham.gloss.Glosser
public class Glosser
A glosser for this system is an binary object that represents a modular vocabulary, ie, it is able to read tokens from a token stream (a Tokenizer object) and create an XML document. The same glosser once built can parse several token streams producing several XML documents. For information on the format and commands available in the mv file see the modularvocabulary.dtd dtd file and notes further down in the documentation for this class.
Field Summary | |
---|---|
java.lang.String |
mvURI
The namespace URI of the mv elements. |
Constructor Summary | |
---|---|
Glosser(org.w3c.dom.Document mV,
javax.xml.parsers.DocumentBuilder dB,
Logger l)
Construct a glosser object using the modularvocab from the parsed mv document given and the logger given. |
|
Glosser(java.lang.String modularvocab,
Logger l)
Construct a glosser object using the modularvocab from the URI given and the logger object given. |
Method Summary | |
---|---|
int |
col()
returns -1 to say the column number of position in the MV document is not available |
protected void |
compileMode(Mode mode)
This method compiles the mode given. |
java.lang.String |
doc()
returns the name of the MV document |
GlossExecution |
execution()
The accessor method for the execution object. |
protected Mode |
findMode(java.lang.String modeName)
Find the element describing the mode given by modeName. |
protected void |
getModes(org.w3c.dom.Element mvElt,
ParameterContainer prefixes)
The getModes method collects together all the modes for this MV and compiles or preprocesses them. |
java.lang.String |
getValue(java.lang.String key)
Returns the value of the parameter with this name or null if there is no such parameter. |
org.w3c.dom.Document |
gloss(java.lang.String documentname,
java.io.InputStreamReader isr)
Glosses token data from InputStreamReader "isr" against the modular vocabulary preloaded in this glosser. |
org.w3c.dom.Document |
gloss(Tokenizer lex)
Glosses token data from the Tokenizer given against the modular vocabulary preloaded in this glosser. |
protected void |
initParameters(org.w3c.dom.Element mvElt,
ParameterContainer params,
ParameterContainer prefixes)
|
int |
line()
returns -1 to say the line number of position in the MV document is not available |
Logger |
logger()
accessor for this glosser's logger object |
void |
putValue(java.lang.String key,
java.lang.String value)
Puts a new parameter into the list of global parameters or overwrites an existing one. |
void |
putValues(ParameterContainer pc)
Puts a set of parameter into the list of global parameters. |
protected void |
resolveMode(Mode m)
This method resolves any remaining mode attributes from any declared template for that mode. |
void |
setLogger(Logger l)
Sets the logger of this glosser. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.String mvURI
Constructor Detail |
---|
public Glosser(java.lang.String modularvocab, Logger l) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, GlossException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
GlossException
public Glosser(org.w3c.dom.Document mV, javax.xml.parsers.DocumentBuilder dB, Logger l) throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, GlossException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
GlossException
Method Detail |
---|
public Logger logger()
public void setLogger(Logger l)
public java.lang.String doc()
doc
in interface Locator
public int col()
col
in interface Locator
public int line()
line
in interface Locator
public java.lang.String getValue(java.lang.String key)
public void putValue(java.lang.String key, java.lang.String value) throws GlossException
GlossException
public void putValues(ParameterContainer pc) throws GlossException
GlossException
public GlossExecution execution()
protected void getModes(org.w3c.dom.Element mvElt, ParameterContainer prefixes) throws GlossException
GlossException
protected void resolveMode(Mode m) throws GlossException
GlossException
protected void compileMode(Mode mode) throws GlossException
GlossException
protected Mode findMode(java.lang.String modeName) throws GlossException
GlossException
public org.w3c.dom.Document gloss(java.lang.String documentname, java.io.InputStreamReader isr) throws GlossException, java.io.IOException
GlossException
java.io.IOException
public org.w3c.dom.Document gloss(Tokenizer lex) throws GlossException
GlossException
protected void initParameters(org.w3c.dom.Element mvElt, ParameterContainer params, ParameterContainer prefixes) throws GlossException
GlossException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |