jcolibri.method.retrieve.NNretrieval.similarity.local.textual
Class TextualSimUtils

java.lang.Object
  extended by jcolibri.method.retrieve.NNretrieval.similarity.local.textual.TextualSimUtils

public class TextualSimUtils
extends java.lang.Object

Utilities to compute textual similarities

Version:
1.0
Author:
Juan A. Recio-Garcia

Nested Class Summary
static class TextualSimUtils.WeightedString
          Represents a string with an asssociated weight.
 
Constructor Summary
TextualSimUtils()
           
 
Method Summary
static void expandTokensSet(java.util.Collection<Token> caseTokens, java.util.Collection<Token> queryToken, java.util.Set<TextualSimUtils.WeightedString> caseSet, java.util.Set<TextualSimUtils.WeightedString> querySet)
          Expands the tokens collections recived containing the tokens of a case and a query.
static double getSize(java.util.Collection<TextualSimUtils.WeightedString> col)
          Returns the "size" of a collection having into account that each WeightedString object has an associated weight.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextualSimUtils

public TextualSimUtils()
Method Detail

expandTokensSet

public static void expandTokensSet(java.util.Collection<Token> caseTokens,
                                   java.util.Collection<Token> queryToken,
                                   java.util.Set<TextualSimUtils.WeightedString> caseSet,
                                   java.util.Set<TextualSimUtils.WeightedString> querySet)
Expands the tokens collections recived containing the tokens of a case and a query. The expansion means that new tokens are added to the returned sets depending on the WeightedRelations between the tokens of the case and the query

Parameters:
caseTokens - Input tokens of the case
queryToken - Input tokens of the query
caseSet - Output set containing the tokens of the case represented in WeightedString objects that contain a string (the token) and a weight
querySet - Output set containing the tokens of the query represented in WeightedString objects that contain a string (the token) and a weight

getSize

public static double getSize(java.util.Collection<TextualSimUtils.WeightedString> col)
Returns the "size" of a collection having into account that each WeightedString object has an associated weight.


GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es