public class CompareFingerprint
extends java.lang.Object
implements java.lang.Iterable<java.util.Map.Entry<java.lang.Integer,java.util.List<java.lang.String>>>
Modifier and Type | Field and Description |
---|---|
protected Dictionary |
dictionary |
protected FileLister |
fileLister |
protected Fingerprint |
fing |
protected Fingerprinter |
fingerprint |
protected FingerprintMatcher |
matcher |
protected int |
maxThread |
protected int |
minimum_score |
protected java.util.List<Pair<java.lang.String,java.lang.Integer>> |
resultSet |
protected java.util.SortedMap<java.lang.Integer,java.util.List<java.lang.String>> |
scores |
Constructor and Description |
---|
CompareFingerprint(java.lang.String match,
java.lang.String fingerprintFile,
java.lang.String directory,
int minimumScore,
java.lang.String dictionary)
Constructor that sets the matcher, fingerprint file, directory, minimum score and dictionary to use for this
comparison
|
CompareFingerprint(java.lang.String match,
java.lang.String text,
java.util.Vector<Fingerprint> fingerprints,
int minimumScore,
java.lang.String dictionary)
Constructor that sets the matcher, fingerprint file, directory, minimum score and dictionary to use for this
comparison
|
Modifier and Type | Method and Description |
---|---|
void |
compareFingerprintDirectory()
Compute a fingerprint for each file in this directory and compare it to each other using this matcher; if the
matcher returns boolean values, true values are given a score of 100 and false values are given a score of 0
|
java.util.Iterator<java.util.Map.Entry<java.lang.Integer,java.util.List<java.lang.String>>> |
iterator() |
void |
printScores()
Print all the files and their similarity scores; if a minimum score is provided, only output those files with
scores greater than or equal to the minimum
|
void |
saveScores(java.lang.String fileName) |
void |
writeScores(java.lang.String filename)
Write all the files and their similarity scores to a file; if a minimum score is provided, only output those files
with scores greater than or equal to the minimum
|
protected FileLister fileLister
protected Fingerprinter fingerprint
protected final FingerprintMatcher matcher
protected final int minimum_score
protected final Dictionary dictionary
protected final java.util.SortedMap<java.lang.Integer,java.util.List<java.lang.String>> scores
protected final int maxThread
protected java.util.List<Pair<java.lang.String,java.lang.Integer>> resultSet
protected Fingerprint fing
public CompareFingerprint(java.lang.String match, java.lang.String fingerprintFile, java.lang.String directory, int minimumScore, java.lang.String dictionary)
match
- the string name of the matcher to use for this comparisonfingerprintFile
- the string filename of the fingerprint to compare with this directorydirectory
- the string directory path to compare with this fingerprintminimumScore
- the int
minimum score needed to output a file for this comparisondictionary
- the string filename of the dictionary to use for this comparison; this dictionary will only be used if the
fingerprint file does not already contain a full dictionary
added global variables to set this.minimum_Score -- evanpublic CompareFingerprint(java.lang.String match, java.lang.String text, java.util.Vector<Fingerprint> fingerprints, int minimumScore, java.lang.String dictionary)
match
- the string name of the matcher to use for this comparisontext
- the string that will be matched against the fingerprintsfingerprints
- the fingerprints that were computed from each file to be compared to the textminimumScore
- the int
minimum score needed to output a file for this comparisondictionary
- the string filename of the dictionary to use for this comparison; this dictionary will only be used if the
fingerprint file does not already contain a full dictionary
added global variables to set this.minimum_Score -- evanpublic java.util.Iterator<java.util.Map.Entry<java.lang.Integer,java.util.List<java.lang.String>>> iterator()
iterator
in interface java.lang.Iterable<java.util.Map.Entry<java.lang.Integer,java.util.List<java.lang.String>>>
public void compareFingerprintDirectory()
public void saveScores(java.lang.String fileName)
public void printScores()
public void writeScores(java.lang.String filename)
filename
- the string name of the file to write output