Class Metaphone
Encodes a string into a Metaphone value.
Initial Java implementation by William B. Brogden. December, 1997
.
Permission given by wbrogden
for code to be used anywhere.
Hanging on the Metaphone
by Lawrence Philips
in Computer Language of Dec. 1990,
p 39.
Note, that this does not match the algorithm that ships with PHP, or the algorithm found in the Perl implementations:
- Text:Metaphone-1.96 (broken link 4/30/2013)
- Text:Metaphone-1.96 (link checked 4/30/2013)
They have had undocumented changes from the originally published algorithm. For more information, see CODEC-57.
This class is conditionally thread-safe. The instance field Lucene.Net.Analysis.Phonetic.Language.Metaphone.maxCodeLen is mutable MaxCodeLen but is not volatile, and accesses are not synchronized. If an instance of the class is shared between threads, the caller needs to ensure that suitable synchronization is used to ensure safe publication of the value between threads, and must not set MaxCodeLen after initial setup.
Inheritance
Assembly: Lucene.Net.Analysis.Phonetic.dll
Syntax
public class Metaphone : object, IStringEncoder
Constructors
Name | Description |
---|---|
Metaphone() | Creates an instance of the Metaphone encoder |
Properties
Name | Description |
---|---|
MaxCodeLen | Gets or Sets Lucene.Net.Analysis.Phonetic.Language.Metaphone.maxCodeLen. |
Methods
Name | Description |
---|---|
Encode(String) | Encodes a string using the Metaphone algorithm. |
GetMetaphone(String) | Find the metaphone value of a string. This is similar to the soundex algorithm, but better at finding similar sounding words. All input is converted to upper case. Limitations: Input format is expected to be a single ASCII word with only characters in the A - Z range, no punctuation or numbers. |
IsMetaphoneEqual(String, String) | Tests is the metaphones of two strings are identical. |