de.spieleck.app.ngramj.lm
Class LMDataProfile
java.lang.Object
de.spieleck.app.ngramj.lm.LMDataProfile
- All Implemented Interfaces:
- IterableProfile, LMConstants, Profile
public class LMDataProfile
- extends java.lang.Object
- implements LMConstants, IterableProfile
Profile implementation which reads itself from a text_cat generated
resource.
Field Summary |
protected java.lang.String |
name
|
protected java.util.List |
rankedNGrams
|
Constructor Summary |
LMDataProfile(java.lang.String name,
java.io.InputStream stream)
|
Method Summary |
java.lang.String |
getName()
|
double |
getRank(NGram gram)
Return the rank of a ngram in the corresponsing profile. |
int |
getSize()
|
java.util.Iterator |
ngrams()
Return an iterator over all contained ngrams |
protected void |
readStream(java.io.InputStream stream)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
rankedNGrams
protected java.util.List rankedNGrams
name
protected java.lang.String name
LMDataProfile
public LMDataProfile(java.lang.String name,
java.io.InputStream stream)
readStream
protected void readStream(java.io.InputStream stream)
getRank
public double getRank(NGram gram)
- Description copied from interface:
Profile
- Return the rank of a ngram in the corresponsing profile.
- Specified by:
getRank
in interface Profile
getSize
public int getSize()
getName
public java.lang.String getName()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
ngrams
public java.util.Iterator ngrams()
- Description copied from interface:
IterableProfile
- Return an iterator over all contained ngrams
- Specified by:
ngrams
in interface IterableProfile