All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class jsvm.OrigSvmParser

java.lang.Object
    |
    +----jsvm.OrigSvmParser

public class OrigSvmParser
extends Object
Parses a data file(.trn) containing multiple sets of training examples.
Each set of examples is preceeded with the class name.  For instance:
#(classname1)
(label) (feature):(value) ...
(label) (feature):(value) ...
#(classname2)
(label) (feature):(value) ...
(label) (feature):(value) ...

Version:
$Id$
Author:
Heloise Hse (hwawen@eecs.berkeley.edu)

Constructor Index

 o OrigSvmParser()

Method Index

 o initTokenizer(StreamTokenizer)
Initializes the stream tokenizer.
 o parse(InputStream)
Parses a data file containing multiple sets of training examples.
 o parseClassBody(StreamTokenizer, String, TrainingSet)
Parses the set of examples for type "curType".
 o parseName(StreamTokenizer)
Reads a string up to end-of-line.

Constructors

 o OrigSvmParser
public OrigSvmParser()

Methods

 o parse
public TrainingSet parse(InputStream in) throws IOException
Parses a data file containing multiple sets of training examples. Creates and initializes data structure in Java.

Parameters:
in - The inputstream containing the data to be parsed.
Returns:
The data structure containing the data information.
 o initTokenizer
protected void initTokenizer(StreamTokenizer st)
Initializes the stream tokenizer.

 o parseName
protected String parseName(StreamTokenizer st) throws IOException
Reads a string up to end-of-line.

Parameters:
st - The stream tokenizer contains the data.
Returns:
The string starting from the mark in st to the end-of-line charactor.
 o parseClassBody
protected void parseClassBody(StreamTokenizer st,
                              String curType,
                              TrainingSet set) throws IOException
Parses the set of examples for type "curType".


All Packages  Class Hierarchy  This Package  Previous  Next  Index