infomat.vectorspace.similarity
Class SparseLiteralSimilarity

java.lang.Object
  extended by infomat.vectorspace.similarity.ISimilarity
      extended by infomat.vectorspace.similarity.SparseISimilarity
          extended by infomat.vectorspace.similarity.SparseLiteralSimilarity
All Implemented Interfaces:
HasProperties

public class SparseLiteralSimilarity
extends SparseISimilarity

The literal similarity.


Field Summary
 
Fields inherited from class infomat.vectorspace.similarity.ISimilarity
properties
 
Constructor Summary
SparseLiteralSimilarity()
           
SparseLiteralSimilarity(SparseLiteralSimilarity sim)
           
 
Method Summary
 Properties getDefaultProperties()
           
 IVector<IVectorIndex> getGroupRepresentation(IObjectGroup iog)
           
 java.lang.String getName()
           
 Properties getProperties()
           
 java.lang.Object getPropertyValue(java.lang.String name)
           
 java.util.Vector getPropertyVector()
           
 IVector<IVectorIndex> getRepresentation(IObject io)
          Returns the representation in the form of a IVector.
 void setProperties(Properties properties)
           
 void setProperty(java.lang.String name, java.lang.Object value)
           
 float sim(IObjectGroup iog1, IObjectGroup iog2)
          Calculates the similarity between two IObjectGroup:s.
 float sim(IObject io1, IObject io2)
          Calculates the similarity between two IObject:s.
 float sim(IObject io, IObjectGroup iog)
          Calculates the similarity between IObject and a IObjectGroup.
<U extends IVectorIndex,V extends IVectorIndex>
float
sim(IVector<U> vec1, IVector<V> vec2)
          Calculates the similarity between two representations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SparseLiteralSimilarity

public SparseLiteralSimilarity()

SparseLiteralSimilarity

public SparseLiteralSimilarity(SparseLiteralSimilarity sim)
Method Detail

getDefaultProperties

public Properties getDefaultProperties()

getName

public java.lang.String getName()
Specified by:
getName in class ISimilarity

getPropertyVector

public java.util.Vector getPropertyVector()

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String name)

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
                 throws PropertyNotFoundException
Throws:
PropertyNotFoundException

getProperties

public Properties getProperties()

setProperties

public void setProperties(Properties properties)

sim

public float sim(IObject io1,
                 IObject io2)
Calculates the similarity between two IObject:s. Extracts the representation from the matrix.

Specified by:
sim in class ISimilarity

sim

public float sim(IObject io,
                 IObjectGroup iog)
Calculates the similarity between IObject and a IObjectGroup. Extracts the representation from the matrix. Uses the group representation for IObjectGroup:s of all kinds. This takes more time to extract. Therefore it might be better to use the #getGroupRepresentation-method instead...

Specified by:
sim in class ISimilarity

sim

public float sim(IObjectGroup iog1,
                 IObjectGroup iog2)
Calculates the similarity between two IObjectGroup:s. Extracts the representation from the matrix. Uses the group representation for IObjectGroup:s of all kinds. This takes more time to extract. Therefore it might be better to use the #getGroupRepresentation-method instead...

Specified by:
sim in class ISimilarity

sim

public <U extends IVectorIndex,V extends IVectorIndex> float sim(IVector<U> vec1,
                                                                 IVector<V> vec2)
Calculates the similarity between two representations.

Checks whether the second representation is smaller than first. A small decrease in time is achieved by giving the representation that one believes is smaller as first parameter. (Do not check it also. That increaes time spent.)

Specified by:
sim in class SparseISimilarity

getRepresentation

public IVector<IVectorIndex> getRepresentation(IObject io)
Returns the representation in the form of a IVector.

Specified by:
getRepresentation in class SparseISimilarity

getGroupRepresentation

public IVector<IVectorIndex> getGroupRepresentation(IObjectGroup iog)
Specified by:
getGroupRepresentation in class SparseISimilarity