viv:unstem
returns all terms in the same stem class as the first argument
Synopsis
node-set viv:unstem (str, field, stemmer, dict, max); string str; string field; string stemmer; string dict; integer max;
Description
The viv:unstem function returns a node-set that contains all available terms that have the same stem as the term specified in the first argument. Only the first argument is mandatory.
Arguments
- str: the term for which stemming expansions should be produced
- field: the name of the field associated with the term specified in the first (str) parameter. If no field is specified, the query field is used.
- stemmer: the name of the stemmer to use. If no stemmer is specified, the default stemmer for the current project is used, for which the data Watson™ Explorer Engine default is english+depluralize, as specified by the meta.stem_expand_stemmer option.
- dict: the name of the dictionary to use. If no dictionary is specified, the default dictionary for the current project is used, for which the Watson Explorer Engine default is an English directory named default, as specified by the dictionary option.
- max: the number of stemming expansions that are to be output by the function. Specify -1 to output all available expansions. If no max value is specified, all stemming expansions are returned. If the number of available stemming expansions exceeds the specified maximum, the most frequently occurring terms up to that maximum number are returned. Terms with equal counts are returned in sort order.
Returns
Returns a node-set that contains all terms that have the same stem as the term specified in the first argument. As an example, the call viv:unstem('car') would return a node-set like the following:
<operator logic="or" expand-str="car" expand-logic="stem"> <term str="cars" field="query" count="22078" /> <term str="carly" field="query" count="566" /> <term str="carli" field="query" count="55" /> <term str="carring" field="query" count="25" /> <term str="carlis" field="query" count="8" /> <term str="carful" field="query" count="4" /> <term str="carfully" field="query" count="4" /> <term str="carness" field="query" count="4" /> <term str="carred" field="query" count="2" /> <term str="car" field="query" /> </operator>