opennlp.maxent
Class RealValueFileEventStream

java.lang.Object
  extended by opennlp.maxent.FileEventStream
      extended by opennlp.maxent.RealValueFileEventStream
All Implemented Interfaces:
EventStream

public class RealValueFileEventStream
extends FileEventStream


Constructor Summary
RealValueFileEventStream(java.io.File file)
           
RealValueFileEventStream(java.lang.String fileName)
           
 
Method Summary
static void main(java.lang.String[] args)
          Trains and writes a model based on the events in the specified event file.
 Event nextEvent()
          Returns the next Event object held in this EventStream.
static float[] parseContexts(java.lang.String[] contexts)
          Parses the specified contexts and re-populates context array with features and returns the values for these features.
 
Methods inherited from class opennlp.maxent.FileEventStream
hasNext, toLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealValueFileEventStream

public RealValueFileEventStream(java.lang.String fileName)
                         throws java.io.IOException
Throws:
java.io.IOException

RealValueFileEventStream

public RealValueFileEventStream(java.io.File file)
                         throws java.io.IOException
Throws:
java.io.IOException
Method Detail

parseContexts

public static float[] parseContexts(java.lang.String[] contexts)
Parses the specified contexts and re-populates context array with features and returns the values for these features. If all values are unspecified, then null is returned.

Parameters:
contexts - The contexts with real values specified.
Returns:
The value for each context or null if all values are unspecified.

nextEvent

public Event nextEvent()
Description copied from interface: EventStream
Returns the next Event object held in this EventStream.

Specified by:
nextEvent in interface EventStream
Overrides:
nextEvent in class FileEventStream
Returns:
the Event object which is next in this EventStream

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Trains and writes a model based on the events in the specified event file. the name of the model created is based on the event file name.

Parameters:
args - eventfile [iterations cuttoff]
Throws:
java.io.IOException - when the eventfile can not be read or the model file can not be written.


Copyright © 2005 Jason Baldridge, Gann Bierner, and Thomas Morton. All Rights Reserved.