Finnegan implements Serializable { public Finnegan() { this( new String[]{ "a", "a", "a", "a", "o", "o", "o", "e", "e", "e", "e", "e", "i", "i", "i", "i", "u", "a", "a", "a", "a", "o", "o", "o", "e", "e", "e", "e", "e", "i", "i", "i", "i", "u", "a", "a", "a", "o", "o", "e", "e", "e", "i", "i", "i", "u", "a", "a", "a", "o", "o", "e", "e", "e", "i", "i", "i", "u", "au", "ai", "ai", "ou", "ea", "ie", "io", "ei", }, new String[]{"u", "u", "oa", "oo", "oo", "oo", "ee", "ee", "ee", "ee",}, new String[]{ "b", "bl", "br", "c", "cl", "cr", "ch", "d", "dr", "f", "fl", "fr", "g", "gl", "gr", "h", "j", "k", "l", "m", "n", "p", "pl", "pr", "qu", "r", "s", "sh", "sk", "st", "sp", "sl", "sm", "sn", "t", "tr", "th", "thr", "v", "w", "y", "z", "b", "bl", "br", "c", "cl", "cr", "ch", "d", "dr", "f", "fl", "fr", "g", "gr", "h", "j", "k", "l", "m", "n", "p", "pl", "pr", "r", "s", "sh", "st", "sp", "sl", "t", "tr", "th", "w", "y", "b", "br", "c", "ch", "d", "dr", "f", "g", "h", "j", "l", "m", "n", "p", "r", "s", "sh", "st", "sl", "t", "tr", "th", "b", "d", "f", "g", "h", "l", "m", "n", "p", "r", "s", "sh", "t", "th", "b", "d", "f", "g", "h", "l", "m", "n", "p", "r", "s", "sh", "t", "th", "r", "s", "t", "l", "n", "str", "spr", "spl", "wr", "kn", "kn", "gn", }, new String[]{"x", "cst", "bs", "ff", "lg", "g", "gs", "ll", "ltr", "mb", "mn", "mm", "ng", "ng", "ngl", "nt", "ns", "nn", "ps", "mbl", "mpr", "pp", "ppl", "ppr", "rr", "rr", "rr", "rl", "rtn", "ngr", "ss", "sc", "rst", "tt", "tt", "ts", "ltr", "zz" }, new String[]{"b", "rb", "bb", "c", "rc", "ld", "d", "ds", "dd", "f", "ff", "lf", "rf", "rg", "gs", "ch", "lch", "rch", "tch", "ck", "ck", "lk", "rk", "l", "ll", "lm", "m", "rm", "mp", "n", "nk", "nch", "nd", "ng", "ng", "nt", "ns", "lp", "rp", "p", "r", "rn", "rts", "s", "s", "s", "s", "ss", "ss", "st", "ls", "t", "t", "ts", "w", "wn", "x", "ly", "lly", "z", "b", "c", "d", "f", "g", "k", "l", "m", "n", "p", "r", "s", "t", "w", }, new String[]{"ate", "ite", "ism", "ist", "er", "er", "er", "ed", "ed", "ed", "es", "es", "ied", "y", "y", "y", "y", "ate", "ite", "ism", "ist", "er", "er", "er", "ed", "ed", "ed", "es", "es", "ied", "y", "y", "y", "y", "ate", "ite", "ism", "ist", "er", "er", "er", "ed", "ed", "ed", "es", "es", "ied", "y", "y", "y", "y", "ay", "ay", "ey", "oy", "ay", "ay", "ey", "oy", "ough", "aught", "ant", "ont", "oe", "ance", "ell", "eal", "oa", "urt", "ut", "iom", "ion", "ion", "ision", "ation", "ation", "ition", "ough", "aught", "ant", "ont", "oe", "ance", "ell", "eal", "oa", "urt", "ut", "iom", "ion", "ion", "ision", "ation", "ation", "ition", "ily", "ily", "ily", "adly", "owly", "oorly", "ardly", "iedly", }, new String[]{}, new int[]{1, 2, 3, 4}, new double[]{7, 8, 4, 1}, 0.22, 0.1, 0.0, 0.25, englishSanityChecks, true); } Finnegan();  Finnegan(String[] openingVowels, String[] midVowels, String[] openingConsonants,
                    String[] midConsonants, String[] closingConsonants, String[] closingSyllables, String[] vowelSplitters,
                    int[] syllableLengths, double[] syllableFrequencies, double vowelStartFrequency,
                    double vowelEndFrequency, double vowelSplitFrequency, double syllableEndFrequency);  Finnegan(String[] openingVowels, String[] midVowels, String[] openingConsonants,
                    String[] midConsonants, String[] closingConsonants, String[] closingSyllables, String[] vowelSplitters,
                    int[] syllableLengths, double[] syllableFrequencies, double vowelStartFrequency,
                    double vowelEndFrequency, double vowelSplitFrequency, double syllableEndFrequency,
                    Pattern[] sane, boolean clean); private  Finnegan(String[] openingVowels, String[] midVowels, String[] openingConsonants,
                            String[] midConsonants, String[] closingConsonants, String[] closingSyllables,
                            String[] vowelSplitters, LinkedHashMap<Integer, Double> syllableFrequencies,
                            double vowelStartFrequency, double vowelEndFrequency, double vowelSplitFrequency,
                            double syllableEndFrequency, Pattern[] sanityChecks, boolean clean, RNG rng,
                            Collection<Modifier> modifiers); String removeAccents(CharSequence str); String word(boolean capitalize); String word(long seed, boolean capitalize); String word(boolean capitalize, int approxSyllables); String word(long seed, boolean capitalize, int approxSyllables); String sentence(int minWords, int maxWords); String sentence(int minWords, int maxWords, String[] midPunctuation, String[] endPunctuation,
                           double midPunctuationFrequency); String sentence(long seed, int minWords, int maxWords, String[] midPunctuation, String[] endPunctuation,
                           double midPunctuationFrequency); String sentence(int minWords, int maxWords, String[] midPunctuation, String[] endPunctuation,
                           double midPunctuationFrequency, int maxChars); String sentence(long seed, int minWords, int maxWords, String[] midPunctuation, String[] endPunctuation,
                           double midPunctuationFrequency, int maxChars); Finnegan mix(Finnegan other, double otherInfluence); Finnegan addAccents(double vowelInfluence, double consonantInfluence); Finnegan removeAccents(); Finnegan addModifiers(Collection<Modifier> mods); Finnegan addModifiers(Modifier... mods); Finnegan removeModifiers(); static Modifier modifier(String pattern, String replacement); static Modifier modifier(String pattern, String replacement, double chance); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); long getSeed(); void setSeed(long seed); Finnegan copy(); final String[] openingVowels; public boolean clean; final LinkedHashMap<Integer, Double> syllableFrequencies; final double vowelStartFrequency; public ArrayList<Modifier> modifiers; static final Pattern[] vulgarChecks; public RNG rng; static final char[][] accentedVowels; static final Finnegan LOVECRAFT; static final Finnegan ENGLISH; static final Finnegan GREEK_ROMANIZED; static final Finnegan GREEK_AUTHENTIC; static final Finnegan FRENCH; static final Finnegan RUSSIAN_ROMANIZED; static final Finnegan RUSSIAN_AUTHENTIC; static final Finnegan JAPANESE_ROMANIZED; static final Finnegan SWAHILI; static final Finnegan SOMALI; static final Finnegan HINDI_ROMANIZED; static final Finnegan FANTASY_NAME; static final Finnegan FANCY_FANTASY_NAME; }
@Test public void testFinnegan() { Finnegan fin = Finnegan.ENGLISH; fin.setSeed(0xf00df00l); for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(5, 10, new String[]{",", ",", ",", ";"}, new String[]{".", ".", ".", "!", "?", "..."}, 0.17, 40)); } fin = Finnegan.LOVECRAFT; for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(3, 9, new String[]{",", ",", ";"}, new String[]{".", ".", "!", "!", "?", "...", "..."}, 0.15, 30)); } fin = Finnegan.GREEK_ROMANIZED; for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(4, 11, new String[]{",", ",", ";"}, new String[]{".", ".", ".", "!", "?", "..."}, 0.2, 50)); } fin = Finnegan.GREEK_AUTHENTIC; for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(4, 11, new String[]{",", ",", ";"}, new String[]{".", ".", ".", "!", "?", "..."}, 0.2, 50)); } fin = Finnegan.FRENCH; for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(4, 12, new String[]{",", ",", ",", ";", ";"}, new String[]{".", ".", ".", "!", "?", "..."}, 0.17, 30)); } fin = Finnegan.RUSSIAN_ROMANIZED; for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(4, 13, new String[]{",", ",", ",", ",", ";", " -"}, new String[]{".", ".", ".", "!", "?", "..."}, 0.25, 30)); } fin = Finnegan.RUSSIAN_AUTHENTIC; for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(4, 13, new String[]{",", ",", ",", ",", ";", " -"}, new String[]{".", ".", ".", "!", "?", "..."}, 0.25, 30)); } fin = Finnegan.ENGLISH.mix(Finnegan.FRENCH, 0.5); for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(5, 11, new String[]{",", ",", ";"}, new String[]{".", ".", "!", "?", "..."}, 0.18)); } fin = Finnegan.FRENCH.mix(Finnegan.GREEK_ROMANIZED, 0.55); for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(6, 12, new String[]{",", ",", ",", ";"}, new String[]{".", ".", "!", "?", "..."}, 0.22)); } fin = Finnegan.ENGLISH.mix(Finnegan.GREEK_AUTHENTIC, 0.25); for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(5, 11, new String[]{",", ",", ";"}, new String[]{".", ".", "!", "?", "..."}, 0.18)); } fin = Finnegan.ENGLISH.addAccents(0.5, 0.15); for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(5, 12, new String[]{",", ",", ";"}, new String[]{".", ".", "!", "?", "..."}, 0.18)); } fin = Finnegan.RUSSIAN_ROMANIZED.mix(Finnegan.ENGLISH, 0.4); for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(4, 10, new String[]{",", ",", ",", ",", ";", " -"}, new String[]{".", ".", ".", "!", "?", "..."}, 0.22)); } fin = Finnegan.RUSSIAN_AUTHENTIC.mix(Finnegan.ENGLISH, 0.4); for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(4, 10, new String[]{",", ",", ",", ",", ";", " -"}, new String[]{".", ".", ".", "!", "?", "..."}, 0.22)); } fin = Finnegan.JAPANESE_ROMANIZED; for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(5, 8, new String[]{",", ",", ",", ",", ";", ";"}, new String[]{".", ".", ".", "!", "?", "...", "..."}, 0.12, 50)); } fin = Finnegan.SWAHILI; for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(5, 8, new String[]{",", ",", ",", ",", ";", ";"}, new String[]{".", ".", ".", "!", "?", "...", "..."}, 0.12, 50)); } fin = Finnegan.SOMALI; for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(5, 8, new String[]{",", ",", ",", ",", ";", ";"}, new String[]{".", ".", ".", "!", "?", "...", "..."}, 0.12, 50)); } fin = Finnegan.HINDI_ROMANIZED; for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(5, 8, new String[]{",", ",", ",", ",", ";", ";"}, new String[]{".", ".", ".", "!", "?", "...", "..."}, 0.12, 50)); } fin = Finnegan.FANTASY_NAME; for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(3, 7, new String[]{",", ",", ",", ",", ";", ";"}, new String[]{".", ".", ".", "!", "!", "?", "...", "..."}, 0.2, 50)); } fin = Finnegan.FANCY_FANTASY_NAME; for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(3, 7, new String[]{",", ",", ",", ",", ";", ";"}, new String[]{".", ".", ".", "!", "!", "?", "...", "..."}, 0.2, 50)); } fin = Finnegan.FRENCH.mix(Finnegan.JAPANESE_ROMANIZED, 0.5) .mix(Finnegan.RUSSIAN_ROMANIZED, 0.1).mix(Finnegan.GREEK_ROMANIZED, 0.075); for (int i = 0; i < 40; i++) { System.out.println(fin.sentence(3, 7, new String[]{",", ",", ",", ",", ";", ";"}, new String[]{".", ".", ".", "!", "!", "?", "...", "..."}, 0.2, 50)); } System.out.println(Finnegan.ENGLISH.word(0xBABABADAL, false)); }