============================================================
               LossyCountingAnalyzer Read Me
============================================================
LossyCountinAnalyzer is the Java implementation of the Lossy 
Counting Algorithm that you can find at:

http://www-db.stanford.edu/~manku/papers/02vldb-freq.pdf

The LossyCountingAnalyzer program takes an input stream made 
of text and compute the words with the highest frequency. 
The results displayed are not exact but they are in a range 
of error (epsilon) set up by the user.
============================================================ 
                  SystemRequirements 
============================================================
The program has been tested on a Linux machine (Red Hat 
9.0B). The java platform used is version "1.4.2_04" Java(TM) 
2 Runtime Environment, Standard Edition (build 
1.4.2_04-b05), but it also worked with java version "1.3.1" 
jdkgcj 0.2.3 (http://www.arklinux.org/projects/jdkgcj)gcj 
(GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5).It has also 
been tested on a Windows 2000 Professional machine with a 
java version"1.4.2_04". 
============================================================ 
             InstallationInstructions 
============================================================
Choose a destination directory and extract the compressed 
file. It should contain the following files: 

-DataStructure.java 
-Entry.java 
-LossyCountingAnalyzer.java <-- (this contains the main()) 
-RowHandling.java 
-SlimEntry.java 
-StopWords.java 
-Windows.java 

-sopwords.txt 
-test.txt (a small text file to make tests...) 
-test.zip 

open a terminal and type: 

[...]$> javac *.java  

to compile the source code. If it doesn't work, probably 
you have to type the complete path to the executable javac. 
For example on Linux machines it should work like this:

[...]$> /usr/bin/javac *.java

If you have no error messages (hopefully!:) you are one step 
away to run the LossyCountinAnalyzer.
============================================================ 
                  Running the Program
============================================================
There are 2 ways to run the program, both from the command 
line:

1. The first option is to give to the program 3 arguments: 
the first one is a Real number identifying SUPPORT (that 
is the threshold we set for results we want to display) 
parameter, the second one is the Real number identifying 
EPSILON (that is the maximum error we'll have in results) 
and the last one is the text file we want to analyze.
The command line goes like the following:

[...]$> java LossyCountingAnalyzer 0.001 0.0001 test.txt

2. the second option is to use the standard input to let the 
program read the text stream and analyze it. One of the way 
to run the program in this mode could be:

[...]$> cat test.txt | java LossyCountingAnalyzer 0.001 
0.0001

notice that now we have only 2 parameters after the name of 
the program.
============================================================ 
                      Some Features
============================================================
- Using the pipe mechanism we can input to the program the 
text streaming directly from a compressed file:

[...]$> unzip -p test.zip | java LossyCountingAnalyzer 0.001 
0.0001

- If we use the 2 way to run the program, we should be 
careful not to insert a third parameter. In that case, the 
program ignores the pipe mechanism and run in the first way, 
hence it'll use the third parameter instead the 
standard input stream.

- stopwords.txt is a file containing words we dislike and we 
don't want to display in the results. The stopwords file is 
a plain text file with a word each row (even a single letter 
is considered as a word). By default the program tries to 
find the stopwords.txt file in the working directory. If it 
cannot find it, the program runs without the stopwords 
filter and a warning message is echoed.

- Rule of Thumb: the epsilon parameter should be 1/10 to 
1/20 of the support parameter as suggests in the original 
algorithm itself.
