eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'PhoneticStringUtilities::PhoneticStringComparator':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: PhoneticStringComparator (private in PhoneticStringUtilities

This class is only visible from within PhoneticStringUtilities.

Inheritance:

   Object
   |
   +--PhoneticStringUtilities::PhoneticStringComparator
      |
      +--PhoneticStringUtilities::DaitchMokotoffStringComparator
      |
      +--PhoneticStringUtilities::DoubleMetaphoneStringComparator
      |
      +--PhoneticStringUtilities::ExtendedSoundexStringComparator
      |
      +--PhoneticStringUtilities::SingleResultPhoneticStringComparator

Package:
stx:libbasic2
Category:
Collections-Text-Support
Owner:
PhoneticStringUtilities

Description:


abstract superclass for various phonetic comparators.
They returns similar strings for similar sounding words, which can be used
to find similar sounding words in a search list.

Notice, that some comparators are better for particular languages.


Class protocol:

constant
o  defaultClass

instance creation
o  new

queries
o  isAbstract

utilities
o  encode: word
SoundexStringComparator encode:'Fischer' -> 'F260'
Caverphone2StringComparator encode:'Fischer' -> 'FSKA111111'
KoelnerPhoneticCodeStringComparator encode:'Fischer' -> '387'
MRAStringComparator encode:'Fischer' -> 'FSCHR'
SpanishPhoneticCodeStringComparator encode:'Fischer' -> '24429'


Instance protocol:

api
o  does: aString soundLike: anotherString
PhoneticStringUtilities::SoundexStringComparator new
does:'miller' soundLike:'miler'.

PhoneticStringUtilities::SoundexStringComparator new
does:'miller' soundLike:'milner'.

PhoneticStringUtilities::SoundexStringComparator new
does:'müller' soundLike:'mueller'.

PhoneticStringUtilities::KoelnerPhoneticCodeStringComparator new
does:'müller' soundLike:'mueller'.

o  phoneticStringsFor: aString
Should answer an array of alternate phonetic strings for the given input string.

** This method raises an error - it must be redefined in concrete classes **

initialization
o  initialize
Invoked when a new instance is created.

usage example(s):

super initialize.   -- commented since inherited method does nothing


Examples:


PhoneticStringUtilities::SoundexStringComparator new does:'miller' soundLike:'miler'. PhoneticStringUtilities::SoundexStringComparator new does:'miller' soundLike:'milner'. PhoneticStringUtilities::SoundexStringComparator new does:'müller' soundLike:'mueller'. PhoneticStringUtilities::KoelnerPhoneticCodeStringComparator new does:'müller' soundLike:'mueller'.

ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Sat, 26 Nov 2022 09:27:43 GMT