opennlp.maxent.io
Class SuffixSensitiveGISModelWriter

java.lang.Object
  extended by opennlp.model.AbstractModelWriter
      extended by opennlp.maxent.io.GISModelWriter
          extended by opennlp.maxent.io.SuffixSensitiveGISModelWriter

public class SuffixSensitiveGISModelWriter
extends GISModelWriter

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
    SuffixSensitiveGISModelWriter(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.maxent.io.GISModelWriter
    persist
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    SuffixSensitiveGISModelWriter

    public SuffixSensitiveGISModelWriter(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 © 2011 The Apache Software Foundation. All Rights Reserved.