edu.udo.cs.miningmart.schemamatching
Class NgramMatcher

java.lang.Object
  extended by edu.udo.cs.miningmart.schemamatching.MmSchemaMatcher
      extended by edu.udo.cs.miningmart.schemamatching.NameAndTypeBasedSchemaMatcher
          extended by edu.udo.cs.miningmart.schemamatching.NgramMatcher

public class NgramMatcher
extends NameAndTypeBasedSchemaMatcher

A simple matcher based on a comparison of all possible pairs of n-grams of two strings. The value of n is set in the constructor.

Version:
$Id: NgramMatcher.java,v 1.5 2006/09/27 15:00:03 euler Exp $
Author:
Timm Euler

Field Summary
 
Fields inherited from class edu.udo.cs.miningmart.schemamatching.MmSchemaMatcher
THRESHOLD
 
Constructor Summary
NgramMatcher(int n)
          Constructor.
 
Method Summary
 double getNameSimilarity(java.lang.String str1, java.lang.String str2)
          Returns the double value that this matcher considers as the similarity between the two given Strings.
 double getStringSimilarity(java.lang.String ngram1, java.lang.String ngram2)
          This method is used to compare the "atoms", ie the n-grams (Strings of length n); see MmSchemaMatcher.getSimilarityMatrix(Collection, Collection)
 
Methods inherited from class edu.udo.cs.miningmart.schemamatching.NameAndTypeBasedSchemaMatcher
getDirectSimilarity, getDirectSimilarity, getSimilarityInvolvingConcepts
 
Methods inherited from class edu.udo.cs.miningmart.schemamatching.MmSchemaMatcher
getDatatypeSimilarity, getGlobalSimilarity, getSimilarity, getSimilarity, getSimilarityMatrix, getSimilarityMatrix, getSimilarMatchingsGreedy, objectsAreSimilar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NgramMatcher

public NgramMatcher(int n)
Constructor. Allows to set the length of an n-gram.

Parameters:
n - the length of an n-gram
Method Detail

getNameSimilarity

public double getNameSimilarity(java.lang.String str1,
                                java.lang.String str2)
                         throws SchemaMatchException
Description copied from class: MmSchemaMatcher
Returns the double value that this matcher considers as the similarity between the two given Strings.

Specified by:
getNameSimilarity in class MmSchemaMatcher
Parameters:
str1 - One String
str2 - Another String
Returns:
a similarity value
Throws:
SchemaMatchException
See Also:
MmSchemaMatcher.getNameSimilarity(String, String)

getStringSimilarity

public double getStringSimilarity(java.lang.String ngram1,
                                  java.lang.String ngram2)
This method is used to compare the "atoms", ie the n-grams (Strings of length n); see MmSchemaMatcher.getSimilarityMatrix(Collection, Collection)

Overrides:
getStringSimilarity in class NameAndTypeBasedSchemaMatcher
Parameters:
ngram1 - One String
ngram2 - Another String
Returns:
a similarity value


Copyright © 2001-2005