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)
-
OrigSvmParser()
-
-
initTokenizer(StreamTokenizer)
- Initializes the stream tokenizer.
-
parse(InputStream)
- Parses a data file containing multiple sets
of training examples.
-
parseClassBody(StreamTokenizer, String, TrainingSet)
- Parses the set of examples for type "curType".
-
parseName(StreamTokenizer)
- Reads a string up to end-of-line.
OrigSvmParser
public OrigSvmParser()
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.
initTokenizer
protected void initTokenizer(StreamTokenizer st)
- Initializes the stream tokenizer.
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.
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