Jacson

de.spieleck.app.ngramj
Class EntryProfile

java.lang.Object
  extended by de.spieleck.app.ngramj.EntryProfile
All Implemented Interfaces:
Constants, Profile

public class EntryProfile
extends java.lang.Object
implements Profile, Constants

A profile to be created from a file. Use this if you have an abitrary bunch of bytes to be repackaged into ngrams. Note if you have an byte-Array in memory, you can feed it into this class via a ByteArrayInputStream.

Version:
$Revision: 2 $ $Date: 2006-03-27 23:00:21 +0200 (Mo, 27 Mrz 2006) $ $Author: nestefan $
Author:
Frank S. Nestel, $Author: nestefan $

Field Summary
protected  java.util.HashMap grams
           
protected  int theLimit
           
 
Constructor Summary
EntryProfile(java.io.InputStream stream)
           
EntryProfile(java.io.InputStream stream, int theLimit)
           
EntryProfile(java.lang.String fname)
           
EntryProfile(java.lang.String fname, int theLimit)
           
 
Method Summary
protected  void digestStream(java.io.InputStream stream)
           
 double getRank(NGram ng)
          Return the rank of a ngram in the corresponsing profile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

grams

protected java.util.HashMap grams

theLimit

protected int theLimit
Constructor Detail

EntryProfile

public EntryProfile(java.lang.String fname)
             throws java.io.IOException,
                    java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

EntryProfile

public EntryProfile(java.lang.String fname,
                    int theLimit)
             throws java.io.IOException,
                    java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

EntryProfile

public EntryProfile(java.io.InputStream stream)
             throws java.io.IOException
Throws:
java.io.IOException

EntryProfile

public EntryProfile(java.io.InputStream stream,
                    int theLimit)
             throws java.io.IOException
Throws:
java.io.IOException
Method Detail

digestStream

protected void digestStream(java.io.InputStream stream)
                     throws java.io.IOException
Throws:
java.io.IOException

getRank

public double getRank(NGram ng)
Description copied from interface: Profile
Return the rank of a ngram in the corresponsing profile.

Specified by:
getRank in interface Profile

spieleck.de