org.apache.commons.codec.language.bm
Class PhoneticEngine.RulesApplication
java.lang.Object
org.apache.commons.codec.language.bm.PhoneticEngine.RulesApplication
- Enclosing class:
- PhoneticEngine
private static final class PhoneticEngine.RulesApplication
- extends Object
A function closure capturing the application of a list of rules to an input sequence at a particular offset.
After invocation, the values i
and found
are updated. i
points to the
index of the next char in input
that must be processed next (the input up to that index having been
processed already), and found
indicates if a matching rule was found or not. In the case where a
matching rule was found, phonemeBuilder
is replaced with a new buidler containing the phonemes
updated by the matching rule.
- Since:
- 1.6
- Author:
- Apache Software Foundation
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
finalRules
private final List<Rule> finalRules
input
private final CharSequence input
phonemeBuilder
private PhoneticEngine.PhonemeBuilder phonemeBuilder
i
private int i
found
private boolean found
PhoneticEngine.RulesApplication
public PhoneticEngine.RulesApplication(List<Rule> finalRules,
CharSequence input,
PhoneticEngine.PhonemeBuilder phonemeBuilder,
int i)
getI
public int getI()
getPhonemeBuilder
public PhoneticEngine.PhonemeBuilder getPhonemeBuilder()
invoke
public PhoneticEngine.RulesApplication invoke()
- Invokes the rules. Loops over the rules list, stopping at the first one that has a matching context
and pattern. Then applies this rule to the phoneme builder to produce updated phonemes. If there was no
match,
i
is advanced one and the character is silently dropped from the phonetic spelling.
- Returns:
this
isFound
public boolean isFound()
commons-codec version 1.6-SNAPSHOT - Copyright © 2002-2012 - Apache Software Foundation