public class EnglishDecruftifier
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
EnglishDecruftifier.CruftySpelling
Holds spelling in process of decruftification.
|
Modifier and Type | Field and Description |
---|---|
protected static java.util.List<PatternReplacer> |
cmList1
Lists of combining macron replacement patterns.
|
protected static java.util.List<PatternReplacer> |
cmList2 |
protected static java.util.regex.Pattern |
initIVowelPattern |
protected static java.lang.String |
initIVowelPatternReplacement |
protected static java.util.regex.Pattern |
initPrefixvVowelPattern |
protected static java.lang.String |
initPrefixvVowelPatternReplacement |
protected static java.util.regex.Pattern |
initUVowelPattern |
protected static java.lang.String |
initUVowelPatternReplacement |
protected static java.util.Map<java.lang.String,java.lang.String> |
macronMap
Demacronization map.
|
protected static java.lang.String |
macronMapResourceName
Macron map resource file.
|
protected static java.util.regex.Pattern |
prefixUVowelPattern |
protected static java.lang.String |
prefixUVowelPatternReplacement |
protected static java.util.regex.Pattern |
syllableIsyllablePattern |
protected static java.lang.String |
syllableIsyllablePatternReplacement |
protected static java.util.regex.Pattern |
underlineCapCap |
protected static java.lang.String |
underlineCapCapPatternReplacement |
protected static java.util.regex.Pattern |
vConsonantPattern |
protected static java.lang.String |
vConsonantPatternReplacement |
protected static java.util.regex.Pattern |
vuvPattern |
protected static java.lang.String |
vuvPatternReplacement |
Modifier | Constructor and Description |
---|---|
protected |
EnglishDecruftifier()
Allow overrides but not instantiation.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
addCombiningMacronPattern(java.util.List<PatternReplacer> list,
java.lang.String pattern,
java.lang.String replacement)
Add entry to combining macrons replacement list.
|
static java.lang.String |
decruftify(java.lang.String cruftySpelling)
Decruftify a spelling (extended).
|
static java.lang.String[] |
decruftify2(java.lang.String cruftySpelling)
Decruftify a spelling (simple and extended).
|
static EnglishDecruftifier.CruftySpelling |
decruftifyStep1(java.lang.String cruftySpelling)
Decruftify step one.
|
static EnglishDecruftifier.CruftySpelling |
decruftifyStep2(java.lang.String cruftySpelling)
Decruftify step two.
|
static EnglishDecruftifier.CruftySpelling |
decruftifyStep3(java.lang.String cruftySpelling)
Decruftify step three.
|
static java.lang.String |
fixEnd(java.lang.String spelling,
java.lang.String ending,
java.lang.String replacement)
Replace string at end of spelling.
|
static java.lang.String |
fixStart1(java.lang.String spelling,
java.lang.String charsToEvict)
Remove specified leading characters from spelling.
|
static java.lang.String |
patternReplacer(java.util.regex.Pattern pattern,
java.lang.String result,
java.lang.String replacement) |
static java.lang.String |
patternReplacer(java.lang.String pattern,
java.lang.String result,
java.lang.String replacement) |
static java.lang.String |
replaceCombiningMacrons(java.lang.String s,
java.util.List<PatternReplacer> cmList)
Replace combining macrons.
|
static java.lang.String |
replacePatterns(java.lang.String s,
java.util.List<PatternReplacer> patternList)
Replace patterns.
|
static java.lang.String |
simpleDecruftify(java.lang.String cruftySpelling)
Decruftify a spelling (simple).
|
protected static java.util.List<PatternReplacer> cmList1
protected static java.util.List<PatternReplacer> cmList2
protected static java.util.regex.Pattern vConsonantPattern
protected static java.lang.String vConsonantPatternReplacement
protected static java.util.regex.Pattern vuvPattern
protected static java.lang.String vuvPatternReplacement
protected static java.util.regex.Pattern initUVowelPattern
protected static java.lang.String initUVowelPatternReplacement
protected static java.util.regex.Pattern initPrefixvVowelPattern
protected static java.lang.String initPrefixvVowelPatternReplacement
protected static java.util.regex.Pattern initIVowelPattern
protected static java.lang.String initIVowelPatternReplacement
protected static java.util.regex.Pattern prefixUVowelPattern
protected static java.lang.String prefixUVowelPatternReplacement
protected static java.util.regex.Pattern syllableIsyllablePattern
protected static java.lang.String syllableIsyllablePatternReplacement
protected static java.util.regex.Pattern underlineCapCap
protected static java.lang.String underlineCapCapPatternReplacement
protected static java.util.Map<java.lang.String,java.lang.String> macronMap
protected static final java.lang.String macronMapResourceName
protected EnglishDecruftifier()
protected static void addCombiningMacronPattern(java.util.List<PatternReplacer> list, java.lang.String pattern, java.lang.String replacement)
list
- List.pattern
- Pattern.replacement
- Replacement.public static java.lang.String replaceCombiningMacrons(java.lang.String s, java.util.List<PatternReplacer> cmList)
s
- String in which to replace macrons.cmList
- List of combining macron replacement patterns.public static java.lang.String replacePatterns(java.lang.String s, java.util.List<PatternReplacer> patternList)
s
- String in which to replace patterns.patternList
- List of replacement patterns.public static java.lang.String fixEnd(java.lang.String spelling, java.lang.String ending, java.lang.String replacement)
spelling
- The spelling.ending
- The ending string to look for.replacement
- The replacement string.public static java.lang.String fixStart1(java.lang.String spelling, java.lang.String charsToEvict)
spelling
- The spelling.charsToEvict
- Character to evict from start of spelling.public static java.lang.String patternReplacer(java.util.regex.Pattern pattern, java.lang.String result, java.lang.String replacement)
public static java.lang.String patternReplacer(java.lang.String pattern, java.lang.String result, java.lang.String replacement)
public static EnglishDecruftifier.CruftySpelling decruftifyStep1(java.lang.String cruftySpelling)
cruftySpelling
- Spelling to decruftify.public static EnglishDecruftifier.CruftySpelling decruftifyStep2(java.lang.String cruftySpelling)
cruftySpelling
- Spelling to decruftify.public static EnglishDecruftifier.CruftySpelling decruftifyStep3(java.lang.String cruftySpelling)
cruftySpelling
- Spelling to decruftify.public static java.lang.String decruftify(java.lang.String cruftySpelling)
cruftySpelling
- The crufty spelling.public static java.lang.String simpleDecruftify(java.lang.String cruftySpelling)
cruftySpelling
- The crufty spelling.public static java.lang.String[] decruftify2(java.lang.String cruftySpelling)
cruftySpelling
- The crufty spelling.