opennlp.perceptron
Class SuffixSensitivePerceptronModelWriter

java.lang.Object
  extended by opennlp.model.AbstractModelWriter
      extended by opennlp.perceptron.PerceptronModelWriter
          extended by opennlp.perceptron.SuffixSensitivePerceptronModelWriter

public class SuffixSensitivePerceptronModelWriter
extends PerceptronModelWriter

A writer for GIS models which inspects the filename and invokes the appropriate GISModelWriter depending on the filename's suffixes.

The following assumption are made about suffixes:

  • .gz --> the file is gzipped (must be the last suffix)
  • .txt --> the file is plain text
  • .bin --> the file is binary


    Constructor Summary
    SuffixSensitivePerceptronModelWriter(AbstractModel model, File f)
              Constructor which takes a GISModel and a File and invokes the GISModelWriter appropriate for the suffix.
     
    Method Summary
     void close()
               
     void writeDouble(double d)
               
     void writeInt(int i)
               
     void writeUTF(String s)
               
     
    Methods inherited from class opennlp.perceptron.PerceptronModelWriter
    persist
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    SuffixSensitivePerceptronModelWriter

    public SuffixSensitivePerceptronModelWriter(AbstractModel model,
                                                File f)
                                         throws IOException
    Constructor which takes a GISModel and a File and invokes the GISModelWriter appropriate for the suffix.

    Parameters:
    model - The GISModel which is to be persisted.
    f - The File in which the model is to be stored.
    Throws:
    IOException
    Method Detail

    writeUTF

    public void writeUTF(String s)
                  throws IOException
    Specified by:
    writeUTF in class AbstractModelWriter
    Throws:
    IOException

    writeInt

    public void writeInt(int i)
                  throws IOException
    Specified by:
    writeInt in class AbstractModelWriter
    Throws:
    IOException

    writeDouble

    public void writeDouble(double d)
                     throws IOException
    Specified by:
    writeDouble in class AbstractModelWriter
    Throws:
    IOException

    close

    public void close()
               throws IOException
    Specified by:
    close in class AbstractModelWriter
    Throws:
    IOException


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