hhreco.recognition
Class MSTrainingWriter

java.lang.Object
  extended byhhreco.recognition.MSTrainingWriter
All Implemented Interfaces:
ModelWriter

public class MSTrainingWriter
extends java.lang.Object
implements ModelWriter

MSTrainingWriter (Multi-Stroke Training Writer) takes a MSTrainingModel and outputs its content to an outputstream.


Constructor Summary
MSTrainingWriter()
           
 
Method Summary
static void writeExample(TimedStroke[] strokes, boolean label, java.io.Writer writer)
          Write the stroke information (x, y, timestamp) and its label (indicating either positive or negative example) to the character-output stream.
static void writeHeader(java.io.Writer writer)
          Write header information to the character-output stream.
 void writeModel(java.lang.Object m, java.io.OutputStream out)
          Write the training model to the output stream.
 void writeModel(java.lang.Object m, java.io.Writer writer)
          Write the training model to the character-output stream.
static void writeStroke(TimedStroke s, java.io.Writer writer)
          Write out the sequence of points in the stroke.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MSTrainingWriter

public MSTrainingWriter()
Method Detail

writeModel

public void writeModel(java.lang.Object m,
                       java.io.OutputStream out)
                throws java.io.IOException
Write the training model to the output stream. The caller is responsible for closing the stream.

Throws:
java.io.IOException

writeModel

public void writeModel(java.lang.Object m,
                       java.io.Writer writer)
                throws java.io.IOException
Write the training model to the character-output stream. The caller is responsible for closing the stream.

Specified by:
writeModel in interface ModelWriter
Throws:
java.io.IOException

writeExample

public static void writeExample(TimedStroke[] strokes,
                                boolean label,
                                java.io.Writer writer)
                         throws java.io.IOException
Write the stroke information (x, y, timestamp) and its label (indicating either positive or negative example) to the character-output stream.

Throws:
java.io.IOException

writeStroke

public static void writeStroke(TimedStroke s,
                               java.io.Writer writer)
                        throws java.io.IOException
Write out the sequence of points in the stroke. This includes the x, y, and timestamp information of a point.

Throws:
java.io.IOException

writeHeader

public static void writeHeader(java.io.Writer writer)
                        throws java.io.IOException
Write header information to the character-output stream.

Throws:
java.io.IOException