public class WordDFIDF extends Object implements ReadWriteable, Comparable<WordDFIDF>
Modifier and Type | Field and Description |
---|---|
long |
tf
Number of tweets in this timeperiod
|
long |
timeperiod
the measurment time period
|
long |
Ttf
Total number of tweets in all timeperiods
|
long |
Twf
Number of tweets containing this word in all timeperiods
|
long |
wf
Number of tweets containing this word in this time period
|
Constructor and Description |
---|
WordDFIDF()
Helpful for reading
|
WordDFIDF(long timeperiod,
long wf,
long tf,
long twf,
long ttf) |
Modifier and Type | Method and Description |
---|---|
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
int |
compareTo(WordDFIDF other) |
double |
dfidf()
DF-IDF as defined by "Event Detection in Twitter by J.
|
boolean |
equals(Object obj) |
int |
hashCode() |
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
String |
toString() |
void |
writeASCII(PrintWriter out)
Write the content of this as ascii to out.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
public long Ttf
public long Twf
public long tf
public long wf
public long timeperiod
public WordDFIDF()
public WordDFIDF(long timeperiod, long wf, long tf, long twf, long ttf)
timeperiod
- the timeperiodwf
- Word count in this timeperiodtf
- Tweet count in this timeperiodtwf
- Word count across all timettf
- Tweet count across all timepublic void writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
out
- sink to write toIOException
- an error writing to outpublic byte[] binaryHeader()
ReadableBinary
binaryHeader
in interface ReadableBinary
binaryHeader
in interface WriteableBinary
public void readBinary(DataInput in) throws IOException
ReadableBinary
readBinary
in interface ReadableBinary
in
- source to read from.IOException
- an error reading inputpublic double dfidf()
public int compareTo(WordDFIDF other)
compareTo
in interface Comparable<WordDFIDF>
public void readASCII(Scanner in) throws IOException
ReadableASCII
readASCII
in interface ReadableASCII
in
- source to read from.IOException
- an error reading inputpublic String asciiHeader()
ReadableASCII
asciiHeader
in interface ReadableASCII
asciiHeader
in interface WriteableASCII
public void writeASCII(PrintWriter out) throws IOException
WriteableASCII
writeASCII
in interface WriteableASCII
out
- sink to write toIOException
- an error writing to out