public class PhoneticEngine
extends java.lang.Object
Converts words into potential phonetic representations.
This is a two-stage process. Firstly, the word is converted into a phonetic representation that takes into account the likely source language. Next, this phonetic representation is converted into a pan-european 'average' representation, allowing comparison between different versions of essentially the same word from different languages.
This class is intentionally immutable. If you wish to alter the settings for a PhoneticEngine, you must make a new one with the updated settings. This makes the class thread-safe.
Ported from phoneticengine.php
| 构造器和说明 |
|---|
PhoneticEngine(NameType nameType,
RuleType ruleType,
boolean concat)
Generates a new, fully-configured phonetic engine.
|
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.String |
encode(java.lang.String input)
Encodes a string to its phonetic representation.
|
java.lang.String |
encode(java.lang.String input,
Languages.LanguageSet languageSet)
Encodes an input string into an output phonetic representation, given a set of possible origin languages.
|
Lang |
getLang()
Gets the Lang language guessing rules being used.
|
NameType |
getNameType()
Gets the NameType being used.
|
RuleType |
getRuleType()
Gets the RuleType being used.
|
boolean |
isConcat()
Gets if multiple phonetic encodings are concatenated or if just the first one is kept.
|
public java.lang.String encode(java.lang.String input)
input - the String to encodepublic java.lang.String encode(java.lang.String input,
Languages.LanguageSet languageSet)
input - String to phoneticise; a String with dashes or spaces separating each wordlanguageSet - public Lang getLang()
public NameType getNameType()
public RuleType getRuleType()
public boolean isConcat()