eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'StringUtilities':

Home

everywhere
www.exept.de
for:
[back]

Class: StringUtilities


Inheritance:

   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

Description:


some less often used algorithms have been moved to here to
make libbasic more compact.


Class protocol:

edit distance
o  editDistanceFrom: s1 to: s2 s: substWeight k: kbdTypoWeight c: caseWeight e: exchangeWeight i: insrtWeight

o  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.

o  isKey: k1 nextTo: k2 onKeyboard: keys
return true, if k1 and k2 are adjacent keys on the keyboard defined by keys

o  keyboardLayout
the keyboard layout (used with algorithms to find possible typing errors,
for example: edit distance in levenshtein)

o  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.

o  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.



ST/X 6.1.1; WebServer 1.620 at exept:8081; Tue, 22 May 2012 22:21:47 GMT