Class Entropy

java.lang.Object
  extended byEntropy

public class Entropy
extends java.lang.Object

Computation of the order k entropy of a text. Usage: Entropy k file. Prints the value of the k-th order entropy of the text contained in file. Uses the classes Element and Buffer.


Constructor Summary
Entropy()
           
 
Method Summary
static float entropy(int k, float[] s, int dim)
          Returns -(1/k)Sigma s[i]log(s[i]).
static void init(java.io.Reader in, int k, int dim, float[] s)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Entropy

public Entropy()
Method Detail

entropy

public static float entropy(int k,
                            float[] s,
                            int dim)
Returns -(1/k)Sigma s[i]log(s[i]).


init

public static void init(java.io.Reader in,
                        int k,
                        int dim,
                        float[] s)
                 throws java.io.IOException
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException