detectLanguage
Introduced in: v22.2.0 Detects the language of the UTF8-encoded input string. The function uses the CLD2 library for detection and returns the 2-letter ISO language code. The longer the input, the more precise the language detection will be. Syntaxtext_to_be_analyzed— The text to analyze.String
un = unknown, can not detect any language, other = the detected language does not have 2 letter code. String
Examples
Basic usage
Query
Response
detectLanguageMixed
Introduced in: v22.2.0 Similar to thedetectLanguage function, but detectLanguageMixed returns a Map of 2-letter language codes that are mapped to the percentage of the certain language in the text.
Syntax
s— The text to analyzeString
Map(String, Float32)
Examples
Mixed languages
Query
Response
lemmatize
Introduced in: v21.9.0 Performs lemmatization on a given word. The English model (en) is built in. It is the LemmaGen model trained on the MULTEXT English lexicon,
licensed under CC BY-SA 4.0.
Models for other languages can be obtained from github
and specified in the server configuration, which also overrides the built-in model:
lang— Language which rules will be applied.Stringword— Lowercase word that needs to be lemmatized.String
String
Examples
English lemmatization
Query
Response
stem
Introduced in: v21.9.0 Performs stemming on a word or an array of words using the Snowball algorithms. Each input string must be a single, lowercase word — strings containing whitespace cause an exception. Passing uppercase characters produces undefined results. Returns String for scalar inputs (including FixedString) and Array(String) for array inputs. Nullable and LowCardinality variants of String and FixedString are supported. The list of supported language identifiers is available in system.stemmers. Syntaxword— A single lowercase word (or array of words) to stem. Must be lowercase — uppercase characters produce undefined results. Accepts String, FixedString, Array(String), Array(FixedString), Array(Nullable(String)), or Array(Nullable(FixedString)).StringorFixedStringorArray(String)orArray(FixedString)language— Language whose stemming rules will be applied. The canonical identifiers are listed in system.stemmers (e.g. ‘english’, ‘german’, ‘porter’). Snowball also accepts 2- or 3-letter ISO 639 codes (e.g. ‘en’, ‘eng’) as aliases where defined, but coverage varies by language — prefer the names fromsystem.stemmersfor portability.String
String or Array(String)
Examples
Stemming a single word
Query
Response
Query
Response
Query
Response
Query
Response