
clang:user-language( $lang as xs:string, $plugin as element(lang:plugin), [$tokenType as xs:string] ) as element(lang:user-language)
This function constructs a user language configuration item, suitable for use with clang:update-user-language.
| Parameters | |
|---|---|
| lang | The language this configuration applies to. An ISO language code, such as "en". |
| plugin | A language plugin configuration item constructed by clang:userLanguagePlugin. |
| tokenType | The token type key for this language. Allowed values: one of the digit characters ('0','1',...,'9'). This only applies for languages that do not already have advanced support. Languages with advanced support already have a distinct token type that cannot be overridden. You should usually omit this parameter. |
tokenType parameter is sometimes needed to distinguish
between multiple user-defined languages. This is an advanced feature
that is not required by most users. If you think you need to use this
capability and you have a current maintenance contract with
MarkLogic, please contact MarkLogic Technical Support.
xquery version "1.0-ml";
import module namespace clang = "http://marklogic.com/xdmp/custom-language"
at "/MarkLogic/custom-language.xqy";
let $lexer := clang:lexer("special_lexer","NFD")
let $stemmer := clang:stemmer("special_stemmer","NFC",("keep-short-vowels=true"))
let $plugin := lang:user-language-plugin("native/special",$lexer,$stemmer)
return clang:user-language("ca", $plugin, "1")