SMILA (incubation) API documentation

org.eclipse.smila.search.lucene.templates.transformer
Class SynonymNodeTransformer

java.lang.Object
  extended by org.eclipse.smila.search.templates.NodeTransformer
      extended by org.eclipse.smila.search.lucene.templates.transformer.SynonymNodeTransformer

public class SynonymNodeTransformer
extends NodeTransformer

The SynonymNodeTransformer is able to expand a search query using synonyms. The search term is supporting wildcards.

Author:
August Georg Schmidt (BROX)

Constructor Summary
SynonymNodeTransformer()
           
 
Method Summary
static java.lang.String[] splitByWholeSeparator(java.lang.String str, java.lang.String separator, int max)
           Splits the provided text into an array, separator string specified.
 ITermContent transformNode(DField dField)
          
 
Methods inherited from class org.eclipse.smila.search.templates.NodeTransformer
getIndexConnection, getParameterDefinition, getParameterSet, setIndexConnection, setParameterSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynonymNodeTransformer

public SynonymNodeTransformer()
                       throws NodeTransformerException
Throws:
NodeTransformerException - Unable to create node transformer.
Method Detail

transformNode

public ITermContent transformNode(DField dField)
                           throws NodeTransformerException

Specified by:
transformNode in class NodeTransformer
Throws:
NodeTransformerException
See Also:
NodeTransformer.transformNode(org.eclipse.smila.search.utils.search.DField)

splitByWholeSeparator

public static java.lang.String[] splitByWholeSeparator(java.lang.String str,
                                                       java.lang.String separator,
                                                       int max)

Splits the provided text into an array, separator string specified. Returns a maximum of max substrings.

The separator(s) will not be included in the returned String array. Adjacent separators are treated as one separator.

A null input String returns null. A null separator splits on whitespace.

     StringUtils.splitByWholeSeparator(null, *, *)               = null
     StringUtils.splitByWholeSeparator("", *, *)                 = []
     StringUtils.splitByWholeSeparator("ab de fg", null, 0)      = ["ab", "de", "fg"]
     StringUtils.splitByWholeSeparator("ab   de fg", null, 0)    = ["ab", "de", "fg"]
     StringUtils.splitByWholeSeparator("ab:cd:ef", ":", 2)       = ["ab", "cd:ef"]
     StringUtils.splitByWholeSeparator("ab-!-cd-!-ef", "-!-", 5) = ["ab", "cd", "ef"]
     StringUtils.splitByWholeSeparator("ab-!-cd-!-ef", "-!-", 2) = ["ab", "cd-!-ef"]
 

Parameters:
str - the String to parse, may be null
separator - String containing the String to be used as a delimiter, null splits on whitespace
max - the maximum number of elements to include in the returned array. A zero or negative value implies no limit.
Returns:
an array of parsed Strings, null if null String was input

SMILA (incubation) API documentation