opennlp.model
Class RealValueFileEventStream

java.lang.Object
  extended by opennlp.model.AbstractEventStream
      extended by opennlp.model.FileEventStream
          extended by opennlp.model.RealValueFileEventStream
All Implemented Interfaces:
Closeable, EventStream

public class RealValueFileEventStream
extends FileEventStream


Constructor Summary
RealValueFileEventStream(File file)
           
RealValueFileEventStream(String fileName)
           
RealValueFileEventStream(String fileName, String encoding)
           
 
Method Summary
static void main(String[] args)
          Trains and writes a model based on the events in the specified event file.
 Event next()
          Returns the next Event object held in this EventStream.
static float[] parseContexts(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.model.FileEventStream
close, hasNext, toLine
 
Methods inherited from class opennlp.model.AbstractEventStream
remove
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealValueFileEventStream

public RealValueFileEventStream(String fileName)
                         throws IOException
Throws:
IOException

RealValueFileEventStream

public RealValueFileEventStream(String fileName,
                                String encoding)
                         throws IOException
Throws:
IOException

RealValueFileEventStream

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

parseContexts

public static float[] parseContexts(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.

next

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

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

main

public static void main(String[] args)
                 throws 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:
IOException - when the eventfile can not be read or the model file can not be written.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.