Changes

Jump to navigation Jump to search
17 bytes added ,  17:52, 21 November 2017
no edit summary
=Conventions=
All functions and errors in this module and errors are assigned to the <code><nowiki>http://basex.org/modules/strings</nowiki></code> namespace, which is statically bound to the {{Code|strings}} prefix.<br/>
=Functions=
|-
| '''Summary'''
|Computes the [https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance Damerau-Levenshtein Distance] for two strings and returns a double value ({{Code|0.0}} - {{Code|1.0}}). The distance returned value is computed as follows:<br/>* <code>1.0 - </code> – distance / max(length of strings)</code>
* <code>1.0</code> is returned if the strings are equal; <code>0.0</code> is returned if the strings are too different.
|-
* In the following query, the input is first normalized (words are stemmed, converted to lower case, and diacritics are removed). It returns {{Code|1}}:
<pre class="brush:xquery">
let $norm := function($s) { ft:normalize($s?, map { 'stemming': true() }) }
return strings:levenshtein($norm("HOUSES"), $norm("house"))
</pre>
|-
| '''Summary'''
|Computes the [https://de.wikipedia.org/wiki/K%C3%B6lner_Phonetik Kölner Phonetik] value for the specified string. The algorithm was published by Hans Joachim Postel in 1969. Similar to Soundex, it the algorithm is used to find similarly pronounced words in , but for the German language. As the first returned digit can be {{Code|0}}, the value is returned as string.
|-
| '''Examples'''
The Module was introduced with Version 8.3.
 
[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu