gr.demokritos.iit.jinsect.documentModel.comparators
Class CachedDocumentComparator
java.lang.Object
gr.demokritos.iit.jinsect.documentModel.comparators.StandardDocumentComparator
gr.demokritos.iit.jinsect.documentModel.comparators.CachedDocumentComparator
- All Implemented Interfaces:
- NotificationListener, SimilarityComparatorListener
public class CachedDocumentComparator
- extends StandardDocumentComparator
- implements NotificationListener
An optimized document comparator that uses cached edge information (via NGramCachedGraphComparator
) for the graph comparison process.
Method Summary |
GraphSimilarity |
getSimilarityBetween(java.lang.Object oFirst,
java.lang.Object oSecond)
Returns the similarity of two given NGramDocument s. |
void |
Notify(java.lang.Object oSender,
java.lang.Object oParams)
Acts as a notifier, outputting debug information to the standard error, indicative of the
comparison progress. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachedDocumentComparator
public CachedDocumentComparator()
- Creates an instance of CachedDocumentComparator, using default importance for graph and histogram (0.5).
CachedDocumentComparator
public CachedDocumentComparator(double dGraphImportance)
getSimilarityBetween
public GraphSimilarity getSimilarityBetween(java.lang.Object oFirst,
java.lang.Object oSecond)
throws java.io.InvalidClassException
- Description copied from class:
StandardDocumentComparator
- Returns the similarity of two given
NGramDocument
s.
- Specified by:
getSimilarityBetween
in interface SimilarityComparatorListener
- Overrides:
getSimilarityBetween
in class StandardDocumentComparator
- Parameters:
oFirst
- The first object participating in the similarity calculation. If not an NGramDocument then an InvalidClassException
is thrown.oSecond
- The first object participating in the similarity calculation. If not an NGramDocument then an InvalidClassException
is thrown.
- Returns:
- A
GraphSimilarity
object indicating the similarity between the two given objects.
- Throws:
java.io.InvalidClassException
- Throws this exception when the objects are not comparable due to class
restrictions.- See Also:
ISimilarity
Notify
public void Notify(java.lang.Object oSender,
java.lang.Object oParams)
- Acts as a notifier, outputting debug information to the standard error, indicative of the
comparison progress.
- Specified by:
Notify
in interface NotificationListener
- Parameters:
oSender
- The sender of the notification.oParams
- The parameter object containing a Double number (0.0 to 1.0), that indicated the percentile
progress of the process.