clang.stemmer( variant as String, [normalization as String?], [args as Sequence], [library as String] ) as element(lang.stemmer)
This function constructs a custom stemmer configuration item, suitable for use with clang.userLanguagePlugin.
clang.stemmer
and when passing a stemmer to
clang.userLanguagePlugin
then the library in the stemmer configuration takes precedence over the
library in the plugin configuration.
For a built-in stemmer, specify an empty string for the library name,
or omit the library
parameter and specify an empty string in
clang.userLanguagePlugin
.
For a user-defined plugin, the library name should be of the form
plugin_path/plugin_id
, such as "native/sample_plugin".
If you omit this parameter, then the library
value from
clang.userLanguagePlugin
will be used.
// Create a stemmer config item for a user-defined plugin, and pass // in a configuration option (keep-short-vowels). 'use strict'; const clang = require('/MarkLogic/custom-language'); clang.stemmer('special_stemmer', 'NFC', Sequence.from(['keep-short-vowels=true']), 'native/sampleplugin');
// Create a stemmer config item from a user-defined plugin (bitext), and // pass in some configuration options. 'use strict'; const clang = require('/MarkLogic/custom-language'); clang:stemmer('bitext', null, Sequence.from(['algorithm=german2', 'lowercase']), '')