Interface SMTableDataObject
- All Superinterfaces:
SimilarityMeasure
- All Known Implementing Classes:
SMTableDataObjectImpl
Despite of dealing with symmetric table similarity measures asymmetric exceptions can be defined.
In this case, the measure is still declared as symmetric because of partial symmetric.
For utilising any methods for setting new similarities it is necessary to build a new object in each case. Overwritings respecting the setNativeObject-methods are not supported.
If no similarity for a query and case is defined the default value DEFAULT_SIMILARITY
will be used. But attention, the default value is "0.0" thus the similarity
between the same DataObject
as query and case result in "0.0". This is in general not the
result a user would expected. The user has to take care that the same object for query and case
is "1.0", for example. This can easily be done with the following code:
AtomicObject ao = ... SMTableDataObject sm = simModel.createSimilarityMeasure(SMTableDataObject.NAME, ao); InstanceEnumerationPredicate iep = ao.getAtomicClass().getInstancePredicate(); AtomicObject values[] = iep.getValues(); for(int i=0; i<values.length; i++) sm.addSimilarity(values[i], values[i], 1.0);
- Author:
- Rainer Maximini
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
If no similarity value is defined between query and case, this default value 0.0 will be used.static final String
Name of similarity measure is "TableDataObject".static final boolean
The default symmetric value is true.Fields inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
LOG_ORDER_NAME_NOT_FOUND
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSimilarity
(AtomicObject queryObject, AtomicObject caseObject, double similarity) Adds a similarity measure for the query and case object.getCaseObjects
(AtomicObject forQuery) getSimilarity
(AtomicObject queryObject, AtomicObject caseObject) boolean
void
removeSimilarity
(AtomicObject queryObject, AtomicObject caseObject) Removes the similarity value for the given query and case object.void
setSymmetric
(boolean symmetric) The similarity table can be interpreted as a symmetric table.Methods inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
compute, getDataClass, getName, getSystemName, isForceOverride, isReusable, setForceOverride
-
Field Details
-
DEFAULT_SIMILARITY
static final double DEFAULT_SIMILARITYIf no similarity value is defined between query and case, this default value 0.0 will be used.- See Also:
-
NAME
Name of similarity measure is "TableDataObject".- See Also:
-
SYMMETRIC_DEFAULT
static final boolean SYMMETRIC_DEFAULTThe default symmetric value is true.- See Also:
-
-
Method Details
-
addSimilarity
Adds a similarity measure for the query and case object.- Parameters:
queryObject
- The query object.caseObject
- The case object.similarity
- The similarity value.
-
getCaseObjects
-
getQueryObjects
DataObjectIterator getQueryObjects()- Returns:
- An iterator over all query objects for that an similarity value exists.
-
getSimilarity
- Parameters:
queryObject
- The query object for that the similarity value is defined.caseObject
- The case object for that the similarity value is defined.- Returns:
- The similarity value for the given query and case object. If no value exists, null will be returned.
-
isSymmetric
boolean isSymmetric()- Returns:
- true if the similarty value table is symetric.
-
setSymmetric
void setSymmetric(boolean symmetric) The similarity table can be interpreted as a symmetric table. That means, that in general sim(query,case) is equal to sim(case,query) if a mapping to query/case or case/query is defined. If a mapping for both is defined it will be interpreted as exception of the symetry.- Parameters:
symmetric
- If the table should be interpreted as symmetric table.
-
removeSimilarity
Removes the similarity value for the given query and case object. If no similarity value is defined nothing will be removed.- Parameters:
queryObject
- The query object for that the similarity value should be removed.caseObject
- The case object for that the similarity value should be removed.
-