it.unitn.disi.smatch.matchers.element.string
Class NGram

java.lang.Object
  extended by it.unitn.disi.smatch.components.Configurable
      extended by it.unitn.disi.smatch.matchers.element.string.NGram
All Implemented Interfaces:
IConfigurable, IStringBasedElementLevelSemanticMatcher

public class NGram
extends Configurable
implements IStringBasedElementLevelSemanticMatcher

Implements NGram matcher. See Element Level Semantic matchers paper for more details.

Accepts the following parameters:

threshold - float parameter, which by default equals 0.9.

gramlength - integer parameter which by default equals 3.

Author:
Mikalai Yatskevich mikalai.yatskevich@comlab.ox.ac.uk,

Field Summary
protected  int gramlength
           
protected  double threshold
           
 
Fields inherited from class it.unitn.disi.smatch.components.Configurable
GLOBAL_PREFIX, globalComponents, properties
 
Constructor Summary
NGram()
           
 
Method Summary
 char match(java.lang.String str1, java.lang.String str2)
          Computes the relation with NGram matcher.
 boolean setProperties(java.util.Properties newProperties)
          Sets component configuration properties.
 
Methods inherited from class it.unitn.disi.smatch.components.Configurable
configureComponent, getComponentProperties, getProperties, loadProperties, makeComponentPrefix, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.unitn.disi.smatch.components.IConfigurable
getProperties, setProperties
 

Field Detail

gramlength

protected int gramlength

threshold

protected double threshold
Constructor Detail

NGram

public NGram()
Method Detail

setProperties

public boolean setProperties(java.util.Properties newProperties)
                      throws ConfigurableException
Description copied from interface: IConfigurable
Sets component configuration properties. The component might check for properties change and reconfigure or reload subcomponents.

Specified by:
setProperties in interface IConfigurable
Overrides:
setProperties in class Configurable
Parameters:
newProperties - a new configuration
Returns:
true if properties have been changed
Throws:
ConfigurableException - ConfigurableException

match

public char match(java.lang.String str1,
                  java.lang.String str2)
Computes the relation with NGram matcher.

Specified by:
match in interface IStringBasedElementLevelSemanticMatcher
Parameters:
str1 - the source input
str2 - the target input
Returns:
synonym or IDK relation


© 2010-2011 Knowdive @ DISI