|
|
Class: StringUtilities
Object
|
+--StringUtilities
- Package:
- stx:libbasic2
- Category:
- Collections-Text-Support
- Version:
- rev:
1.1
date: 2009/08/16 21:07:08
- user: cg
- file: StringUtilities.st directory: libbasic2
- module: stx stc-classLibrary: libbasic2
some less often used algorithms have been moved to here to
make libbasic more compact.
edit distance
-
editDistanceFrom: s1 to: s2 s: substWeight k: kbdTypoWeight c: caseWeight e: exchangeWeight i: insrtWeight
-
-
isKey: k1 nextTo: k2
-
return true, if k1 and k2 are adjacent keys on the keyboard.
This is used to specially priorize plausible typing errors of adjacent keys.
-
isKey: k1 nextTo: k2 onKeyboard: keys
-
return true, if k1 and k2 are adjacent keys on the keyboard defined by keys
-
keyboardLayout
-
the keyboard layout (used with algorithms to find possible typing errors,
for example: edit distance in levenshtein)
-
keyboardLayoutForLanguage: lang
-
the keyboard layout (used with algorithms to find possible typing errors,
for example: edit distance in levenshtein).
CAVEAT: hard coded us- and german keyboards here.
-
levenshteinDistanceFrom: string1 to: string2 s: substWeight k: kbdTypoWeight c: caseWeight e: exchangeWeight i: insrtWeight d: deleteWeight
-
parametrized levenshtein.
return the levenshtein distance of two strings;
this value corrensponds to the number of replacements that have to be
made to get string2 from string1.
The arguments are the costs for
s:substitution,
k:keyboard type (substitution), if nil, s is used
c:case-change, if nil, s is used
i:insertion
d:deletion
e:exchange if nil, s*2 is used
of a character.
See IEEE transactions on Computers 1976 Pg 172 ff.
|