public static class FakeLanguageGen.Modifier
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
FakeLanguageGen.Alteration[] |
alterations |
static FakeLanguageGen.Modifier |
DOUBLE_CONSONANTS
For a language that has a 50% chance to repeat a single consonant.
|
static FakeLanguageGen.Modifier |
DOUBLE_VOWELS
For a language that has a 40% chance to repeat a single Latin vowel (a, e, o, or a variant on one of them
like å or ö, but not merged letters like æ and œ).
|
static FakeLanguageGen.Modifier |
GENERAL_CLEANUP
Some changes that can be applied when sanity checks (which force re-generating a new word) aren't appropriate
for fixing a word that isn't pronounceable.
|
static FakeLanguageGen.Modifier |
HISS
For a character who always lengthens 's' and 'z' sounds not starting a word.
|
static FakeLanguageGen.Modifier |
LIGATURES
Simple changes to merge "ae" into "æ", "oe" into "œ", and any of "aé", "áe", or "áé" into "ǽ".
|
static FakeLanguageGen.Modifier |
LISP
For a character who always pronounces 's', 'ss', and 'sh' as 'th'.
|
static FakeLanguageGen.Modifier |
NO_DOUBLES
For a language that never repeats the same letter twice in a row.
|
static FakeLanguageGen.Modifier |
REDUCE_ACCENTS
Replaces any characters this can produce that aren't in ASCII or Latin-1 with Latin-script stand-ins; this
will often use accented characters, but will only use those present in Latin-1 (which many fonts support).
|
static FakeLanguageGen.Modifier |
SIMPLIFY_NORSE
Removes accented letters and the two non-English consonants from text generated with
FakeLanguageGen.NORSE . |
static FakeLanguageGen.Modifier |
SPLIT_LIGATURES
Simple changes to merge "æ" into "ae", "œ" into "oe", and "ǽ" into "áe".
|
static FakeLanguageGen.Modifier |
STUTTER
For a character who has a 20% chance to repeat a starting consonant or vowel.
|
Constructor and Description |
---|
Modifier() |
Modifier(FakeLanguageGen.Alteration... alts) |
Modifier(java.lang.String pattern,
java.lang.String replacement) |
Modifier(java.lang.String pattern,
java.lang.String replacement,
double chance) |
Modifier and Type | Method and Description |
---|---|
static FakeLanguageGen.Modifier |
charReplacementTable(java.lang.String initial,
java.lang.String change)
Creates a Modifier that will replace the nth char in initial with the nth char in change.
|
static FakeLanguageGen.Modifier |
deserializeFromString(java.lang.String data) |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
static FakeLanguageGen.Modifier |
insertClosingConsonant(java.lang.String insertion,
double chance)
Adds the potential for the String
insertion to be used as a consonant in addition to the consonants
that the language already uses; insertion will replace an existing consonant at the end of a word with a
probability of chance , so chance should be low (0.2 at most) unless you want the newly-inserted
consonant to be likely to end every word of some sentences. |
static FakeLanguageGen.Modifier |
insertClosingVowel(java.lang.String insertion,
double chance)
Adds the potential for the String
insertion to be used as a vowel in addition to the vowels that the
language already uses; insertion will replace an existing vowel at the end of a word with a probability of
chance , so chance should be low (0.2 at most) unless you want the newly-inserted vowel to be likely
to end every word of some sentences. |
static FakeLanguageGen.Modifier |
insertConsonant(java.lang.String insertion,
double chance)
Adds the potential for the String
insertion to be used as a consonant in addition to the consonants
that the language already uses; insertion will replace an existing consonant (at any point in a word that had
a consonant generated) with a probability of chance , so chance should be low (0.1 at most) unless you
want the newly-inserted consonant to be likely to be present in every word of some sentences. |
static FakeLanguageGen.Modifier |
insertOpeningConsonant(java.lang.String insertion,
double chance)
Adds the potential for the String
insertion to be used as a consonant in addition to the consonants
that the language already uses; insertion will replace an existing consonant at the start of a word with a
probability of chance , so chance should be low (0.2 at most) unless you want the newly-inserted
consonant to be likely to start every word of some sentences. |
static FakeLanguageGen.Modifier |
insertOpeningVowel(java.lang.String insertion,
double chance)
Adds the potential for the String
insertion to be used as a vowel in addition to the vowels that the
language already uses; insertion will replace an existing vowel at the start of a word with a probability of
chance , so chance should be low (0.2 at most) unless you want the newly-inserted vowel to be likely
to start every word of some sentences. |
static FakeLanguageGen.Modifier |
insertVowel(java.lang.String insertion,
double chance)
Adds the potential for the String
insertion to be used as a vowel in addition to the vowels that the
language already uses; insertion will replace an existing vowel (at any point in a word that had a vowel
generated) with a probability of chance , so chance should be low (0.1 at most) unless you want the
newly-inserted vowel to be likely to be present in every word of some sentences. |
java.lang.StringBuilder |
modify(IRNG rng,
java.lang.StringBuilder sb) |
static FakeLanguageGen.Modifier |
replacementTable(OrderedMap<java.lang.String,java.lang.String> map)
Creates a Modifier that will replace the nth String key in map with the nth value.
|
static FakeLanguageGen.Modifier |
replacementTable(java.lang.String... pairs)
Creates a Modifier that will replace the (n*2)th String in pairs with the (n*2+1)th value in pairs.
|
java.lang.String |
serializeToString() |
java.lang.String |
toString() |
public final FakeLanguageGen.Alteration[] alterations
public static final FakeLanguageGen.Modifier LISP
public static final FakeLanguageGen.Modifier HISS
public static final FakeLanguageGen.Modifier STUTTER
public static final FakeLanguageGen.Modifier DOUBLE_VOWELS
public static final FakeLanguageGen.Modifier DOUBLE_CONSONANTS
public static final FakeLanguageGen.Modifier NO_DOUBLES
public static final FakeLanguageGen.Modifier SIMPLIFY_NORSE
FakeLanguageGen.NORSE
.
Replaces á, é, í, ý, ó, æ, ú, and ö with a, e, i, y, o, ae, and ou. In some instances, replaces j
with y. Replaces ð and þ with th and th, except for when preceded by s (then it replaces sð or sþ
with st or st) or when the start of a word is fð or fþ, where it replaces with fr or fr.public static final FakeLanguageGen.Modifier LIGATURES
public static final FakeLanguageGen.Modifier SPLIT_LIGATURES
public static final FakeLanguageGen.Modifier GENERAL_CLEANUP
public static final FakeLanguageGen.Modifier REDUCE_ACCENTS
public Modifier()
public Modifier(java.lang.String pattern, java.lang.String replacement)
public Modifier(java.lang.String pattern, java.lang.String replacement, double chance)
public Modifier(FakeLanguageGen.Alteration... alts)
public java.lang.StringBuilder modify(IRNG rng, java.lang.StringBuilder sb)
public static FakeLanguageGen.Modifier charReplacementTable(java.lang.String initial, java.lang.String change)
initial
- a String containing lower-case letters or other symbols to be swapped out of a textchange
- a String containing characters that will replace occurrences of characters in initialpublic static FakeLanguageGen.Modifier replacementTable(OrderedMap<java.lang.String,java.lang.String> map)
map
- containing String keys to replace and String values to use instead; replacements happen in orderpublic static FakeLanguageGen.Modifier replacementTable(java.lang.String... pairs)
pairs
- array or vararg of alternating Strings to search for and Strings to replace with; replacements happen in orderpublic static FakeLanguageGen.Modifier insertVowel(java.lang.String insertion, double chance)
insertion
to be used as a vowel in addition to the vowels that the
language already uses; insertion will replace an existing vowel (at any point in a word that had a vowel
generated) with a probability of chance
, so chance should be low (0.1 at most) unless you want the
newly-inserted vowel to be likely to be present in every word of some sentences.insertion
- the String to use as an additional vowelchance
- the chance for a vowel cluster to be replaced with insertion; normally 0.1 or lesspublic static FakeLanguageGen.Modifier insertConsonant(java.lang.String insertion, double chance)
insertion
to be used as a consonant in addition to the consonants
that the language already uses; insertion will replace an existing consonant (at any point in a word that had
a consonant generated) with a probability of chance
, so chance should be low (0.1 at most) unless you
want the newly-inserted consonant to be likely to be present in every word of some sentences.insertion
- the String to use as an additional consonantchance
- the chance for a consonant cluster to be replaced with insertion; normally 0.1 or lesspublic static FakeLanguageGen.Modifier insertOpeningVowel(java.lang.String insertion, double chance)
insertion
to be used as a vowel in addition to the vowels that the
language already uses; insertion will replace an existing vowel at the start of a word with a probability of
chance
, so chance should be low (0.2 at most) unless you want the newly-inserted vowel to be likely
to start every word of some sentences. Not all languages can start words with vowels, or do that very rarely,
so this might not do anything.insertion
- the String to use as an additional opening vowelchance
- the chance for a vowel cluster at the start of a word to be replaced with insertion; normally 0.2 or lesspublic static FakeLanguageGen.Modifier insertOpeningConsonant(java.lang.String insertion, double chance)
insertion
to be used as a consonant in addition to the consonants
that the language already uses; insertion will replace an existing consonant at the start of a word with a
probability of chance
, so chance should be low (0.2 at most) unless you want the newly-inserted
consonant to be likely to start every word of some sentences. Not all languages can start words with
consonants, or do that very rarely, so this might not do anything.insertion
- the String to use as an additional opening consonantchance
- the chance for a consonant cluster at the start of a word to be replaced with insertion; normally 0.2 or lesspublic static FakeLanguageGen.Modifier insertClosingVowel(java.lang.String insertion, double chance)
insertion
to be used as a vowel in addition to the vowels that the
language already uses; insertion will replace an existing vowel at the end of a word with a probability of
chance
, so chance should be low (0.2 at most) unless you want the newly-inserted vowel to be likely
to end every word of some sentences. Not all languages can end words with vowels, or do that very
rarely, so this might not do anything.insertion
- the String to use as an additional closing vowelchance
- the chance for a vowel cluster at the end of a word to be replaced with insertion; normally 0.2 or lesspublic static FakeLanguageGen.Modifier insertClosingConsonant(java.lang.String insertion, double chance)
insertion
to be used as a consonant in addition to the consonants
that the language already uses; insertion will replace an existing consonant at the end of a word with a
probability of chance
, so chance should be low (0.2 at most) unless you want the newly-inserted
consonant to be likely to end every word of some sentences. Not all languages can end words with consonants,
or do that very rarely, so this might not do anything.insertion
- the String to use as an additional closing consonantchance
- the chance for a consonant cluster at the end of a word to be replaced with insertion; normally 0.2 or lesspublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String serializeToString()
public static FakeLanguageGen.Modifier deserializeFromString(java.lang.String data)
Copyright © Eben Howard 2012–2022. All rights reserved.