|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.util.aelfred.HandlerBase
diva.sketch.recognition.MSTrainingParser
public class MSTrainingParser
MSTrainingParser (Multi-Stroke Training Parser) reads in an XML file and parses it into a MSTrainingModel. The XML file should conform to multiStrokeTrain.dtd format so that it can be parsed correctly.
Field Summary | |
---|---|
static String |
DTD_1
The DTD for sketch files. |
static String |
DTD_URL
The URL where the DTD is stored. |
static String |
EXAMPLE_TAG
Indicate an example. |
static String |
LABEL_TAG
Indicate the label (positive or negative) for an example. |
static String |
MODEL_TAG
Indicate that the file contains a training model. |
static String |
NAME_TAG
Indicate the name of a type. |
static String |
NUM_STROKE_TAG
Indicate the number of strokes in an example. |
static String |
POINTS_TAG
Indicate a set of points in a stroke. |
static String |
PUBLIC_ID
The public identity of the sketch dtd file. |
static String |
STROKE_TAG
Indicate a stroke path. |
static String |
TYPE_TAG
Indicate a type in the training model. |
static String |
VERSION_TAG
Indicate the version of this training model. |
Constructor Summary | |
---|---|
MSTrainingParser()
|
Method Summary | |
---|---|
void |
attribute(String name,
String value,
boolean isSpecified)
Handle an attribute value assignment. |
void |
endElement(String name)
Handle the end of an element. |
Object |
parse(Reader reader)
Create the full path string for the url and parses the file into a MSTrainingModel object. |
Object |
resolveEntity(String publicID,
String systemID)
Resolve an external entity. |
void |
startElement(String name)
Handle the start of an element. |
Methods inherited from class diva.util.aelfred.HandlerBase |
---|
charData, doctypeDecl, endDocument, endExternalEntity, error, ignorableWhitespace, processingInstruction, startDocument, startExternalEntity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PUBLIC_ID
public static final String DTD_URL
public static final String DTD_1
public static final String MODEL_TAG
public static final String VERSION_TAG
public static final String TYPE_TAG
public static final String NAME_TAG
public static final String EXAMPLE_TAG
public static final String LABEL_TAG
public static final String NUM_STROKE_TAG
public static final String POINTS_TAG
public static final String STROKE_TAG
Constructor Detail |
---|
public MSTrainingParser()
Method Detail |
---|
public void attribute(String name, String value, boolean isSpecified)
attribute
in interface XmlHandler
attribute
in class HandlerBase
value
- The value of the attribute, or null if the attribute
is #IMPLIED
.isSpecified
- True if the value was specified, false if it
was defaulted from the DTD.com.microstar.xml.XmlHandler#attribute
public void startElement(String name)
HandlerBase
The default implementation does nothing.
startElement
in interface XmlHandler
startElement
in class HandlerBase
name
- The element type name.XmlHandler.startElement(java.lang.String)
public void endElement(String name)
endElement
in interface XmlHandler
endElement
in class HandlerBase
name
- The element type name.com.microstar.xml.XmlHandler#endElement
public Object parse(Reader reader) throws Exception
parse
in interface ModelParser
Exception
public Object resolveEntity(String publicID, String systemID)
resolveEntity
in interface XmlHandler
resolveEntity
in class HandlerBase
publicId
- The public identifier, or null if none was supplied.systemId
- The system identifier.
XmlHandler.resolveEntity(java.lang.String, java.lang.String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |