word-distance is a weighted edit distance. distance is a score that combines the different distance measures.
I expect it would be possible to implement a spell suggest algorithm in XQuery, but I also expect it would be slower than the built-in spelling suggestions. Are you trying to build spell suggestions or something else? wunder == Walter Underwood Lead Engineer On Jan 13, 2011, at 7:40 PM, David Sewell wrote: > The output of spell:suggest-detailed() includes four value attributes > indicating scores for different variance tests, based (according to the > docs) on the raw values of spell:double-metaphone() and > spell:levenshtein-distance() as applied to two strings. For example, > > <spell:suggestion original="konnstitooshion" > dictionary="/test/temp-dictionary.xml" > xmlns:spell="http://marklogic.com/xdmp/spell"> > <spell:word distance="138" key-distance="0" word-distance="285" > levenshtein-distance="6">constitution</spell:word> > </spell:suggestion> > > @levenshtein-distance is self-explanatory. > > @key-distance seems to be based directly on the double metaphones (in > this case, the double metaphones for "constitution" and > "konnstitooshion" are the same) > > But @distance and @word-distance mean what, exactly? > > Are algorithms available that would allow calculation of these values > using only spell:double-metaphone() and spell:levenshtein-distance(), > without needing to use a dictionary? > > DS > -- > David Sewell, Editorial and Technical Manager > ROTUNDA, The University of Virginia Press > PO Box 400314, Charlottesville, VA 22904-4314 USA > Email: [email protected] Tel: +1 434 924 9973 > Web: http://rotunda.upress.virginia.edu/ > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
