diff --git a/.gitignore b/.gitignore index a2060b0..9354a09 100644 --- a/.gitignore +++ b/.gitignore @@ -61,29 +61,9 @@ gradle-app.setting # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 # gradle/wrapper/gradle-wrapper.properties -### JetBrains template -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries + +# IDE +.idea/* local.properties # Gradle and Maven with auto-import diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index d8bb3f6..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -invitrode \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml deleted file mode 100644 index 294cf23..0000000 --- a/.idea/checkstyle-idea.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/invitrode.iml b/.idea/invitrode.iml deleted file mode 100644 index 78b2cc5..0000000 --- a/.idea/invitrode.iml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 27d8332..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/modules/Invitrode.iml b/.idea/modules/Invitrode.iml deleted file mode 100644 index 682d4c3..0000000 --- a/.idea/modules/Invitrode.iml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/.idea/modules/Invitrode_main.iml b/.idea/modules/Invitrode_main.iml deleted file mode 100644 index a40c223..0000000 --- a/.idea/modules/Invitrode_main.iml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/.idea/modules/invitrode_test.iml b/.idea/modules/invitrode_test.iml deleted file mode 100644 index 7a847a4..0000000 --- a/.idea/modules/invitrode_test.iml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f5c99a7..0000000 --- a/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: java \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md index 5dafcc4..0da3d57 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Maxime Roussy +Copyright (c) 2022 Maxime Roussy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 1ed3428..e4848af 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A Java/Android library to generate random english pronounceable words based on a collection of constructed bi-grams. -[![MIT License](http://img.shields.io/badge/license-MIT-green.svg)](https://github.com/maximeroussy/invitrode/license.md) ![CI Build](https://travis-ci.com/maximeroussy/invitrode.svg?branch=master) [![GitHub release](https://img.shields.io/github/release/maximeroussy/invitrode.svg)](https://GitHub.com/maximeroussy/invitrode/releases/) +[![MIT License](http://img.shields.io/badge/license-MIT-green.svg)](https://github.com/maximeroussy/invitrode/license.md) [![GitHub release](https://img.shields.io/github/release/maximeroussy/invitrode.svg)](https://GitHub.com/maximeroussy/invitrode/releases/) ## Summary This is a lightweight and focused library. There's a single class with only a single public method that's accessible. @@ -14,7 +14,7 @@ This library can be used in an infinite amount of ways: - the list goes on... ## Demo -Here's a simple Android app built with the library that demonstrates it's usage: +Here's a simple Android app built with the library that demonstrates its usage:

@@ -23,13 +23,13 @@ Here's a simple Android app built with the library that demonstrates it's usage: This demo app is available on [Google Play](https://play.google.com/store/apps/details?id=com.maximeroussy.invitrodeandroid). ## Download/Install -The library is available through jCenter, which is included in your repositories by default on Android. For a Java -project, make sure you have jCenter added to your repositories. +The library is available through Maven Central, which is included in your repositories by default on Android. For a Java +project, make sure you have `mavenCentral()` added to your repositories. ### Gradle (preferred): ```gradle -compile 'com.maximeroussy.invitrode:invitrode:2.0.1' +implementation 'com.maximeroussy.invitrode:invitrode:2.0.2' ``` ### Maven: @@ -38,7 +38,7 @@ compile 'com.maximeroussy.invitrode:invitrode:2.0.1' com.maximeroussy.invitrode invitrode - 2.0.1 + 2.0.2 pom ``` @@ -56,15 +56,12 @@ String myNewWord = generator.newWord(int lengthOfWord); ``` ## Inspiration & Credits -Why the name Invitrode? Why make a random word generator? This should suffice: -[https://www.youtube.com/watch?v=FbccrO8qKog](https://www.youtube.com/watch?v=FbccrO8qKog) - Bi-gram source and general concept based on [Scrollback's generate.js](https://github.com/scrollback/scrollback/blob/master/lib/generate.js) & described in [this blog post](https://www.hackerearth.com/notes/random-pronouncable-text-generator/) by Aravind. This is a Java adaptation that will be further developed as a functional and feature rich random word generator. ## License The MIT License (MIT) -Copyright (c) 2019 Maxime Roussy +Copyright (c) 2022 Maxime Roussy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/build.gradle b/build.gradle index f9d64a7..33fde13 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,9 @@ +apply plugin: 'java' +apply plugin: 'java-library' + def versionMajor = 2 def versionMinor = 0 def versionPatch = 2 -group = 'com.maximeroussy.invitrode' -version = "${versionMajor}.${versionMinor}.${versionPatch}" buildscript { repositories { @@ -10,10 +11,6 @@ buildscript { } } -apply plugin: 'java' -apply plugin: 'java-library' -apply plugin: 'maven-publish' - sourceCompatibility = 1.8 repositories { @@ -36,44 +33,57 @@ task javadocJar(type: Jar, dependsOn: javadoc) { from 'build/docs/javadoc' } -def pomConfig = { - licenses { - license { - name 'The MIT License' - url 'https://opensource.org/licenses/MIT' - distribution 'repo' - } - } - developers { - developer { - id 'maximeroussy' - name 'Maxime Roussy' - email 'roussy.maxime@gmail.com' - } - } - - scm { - url 'https://github.com/maximeroussy/invitrode' - } +artifacts { + archives javadocJar, sourcesJar } +apply plugin: 'maven-publish' + publishing { publications { mavenJava(MavenPublication) { - from components.java - artifact sourcesJar + groupId = "com.maximeroussy.invitrode" + artifactId = 'invitrode' + version = "${versionMajor}.${versionMinor}.${versionPatch}" artifact javadocJar - groupId 'com.maximeroussy.invitrode' - artifactId 'invitrode' - version "${versionMajor}.${versionMinor}.${versionPatch}" + artifact sourcesJar + from components.java - pom.withXml { - def root = asNode() - root.appendNode('description', 'A Java library to generate random english pronounceable words.') - root.appendNode('name', 'invitrode') - root.appendNode('url', 'https://github.com/maximeroussy/invitrode') - root.children().last() + pomConfig + pom { + name = 'invitrode' + packaging = 'jar' + description = "A Java library to generate random english pronounceable words." + url = 'https://github.com/maximeroussy/invitrode' + + scm { + connection = 'scm:git:git://github.com/maximeroussy/invitrode.git' + developerConnection = 'scm:git:ssh://github.com:maximeroussy/invitrode.git' + url = 'https://github.com/maximeroussy/invitrode/tree/master' + } + + licenses { + license { + name = 'The MIT License' + url = 'https://opensource.org/licenses/MIT' + distribution = 'repo' + } + } + + developers { + developer { + id = 'maximeroussy' + name = 'Maxime Roussy' + email = 'roussy.maxime@gmail.com' + } + } } } } } + +jar { + into("META-INF/maven/$project.group/$project.name") { + from { generatePomFileForMavenJavaPublication } + rename ".*", "pom.xml" + } +} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b1dddc8..a4b4429 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Mon Sep 17 14:11:31 MDT 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/src/main/java/com/maximeroussy/invitrode/WordGenerator.java b/src/main/java/com/maximeroussy/invitrode/WordGenerator.java index 6d41fb3..b8b5317 100644 --- a/src/main/java/com/maximeroussy/invitrode/WordGenerator.java +++ b/src/main/java/com/maximeroussy/invitrode/WordGenerator.java @@ -9,12 +9,12 @@ */ public class WordGenerator { //Bigram source and general concept based on https://github.com/scrollback/scrollback & described in https://www.hackerearth.com/notes/random-pronouncable-text-generator/ - private static String[] START_BIGRAM = {"TH","OF","AN","IN","TO","CO","BE","HE","RE","HA","WA","FO","WH","MA","WI", "ON","HI","PR","ST","NO","IS","IT","SE","WE","AS","CA","DE","SO","MO","SH","DI","AL","AR","LI","WO","FR","PA","ME","AT","SU","BU","SA","FI","NE","CH","PO","HO","DO","OR","UN","LO","EX","BY","FA","LA","LE","PE","MI","SI","YO","TR","BA","GO","BO","GR","TE","EN","OU","RA","AC","FE","PL","CL","SP","BR","EV","TA","DA","AB","TI","RO","MU","EA","NA","SC","AD","GE","YE","AF","AG","UP","AP","DR","US","PU","CE","IF","RI","VI","IM","AM","KN","OP","CR","OT","JU","QU","TW","GA","VA","VE","PI","GI","BI","FL","BL","EL","JO","FU","HU","CU","RU","OV","OB","KE","EF","PH","CI","KI","NI","SL","EM","SM","VO","MR","WR","ES","DU","TU","AU","NU","GU","OW","SY","OC","EC","ED","ID","JE","AI","EI","SK","OL","GL","EQ","LU","AV","SW","AW","EY","TY"}; - private static String[] LOOKUP_BIGRAM = {"TH","AN","IN","IO","EN","TI","FO","HE","HA","HI","TE","AT","ER","AL","WA", "VE","CO","RE","IT","WI","ME","NC","ON","PR","AR","ES","EV","ST","EA","IV","EC","NO","OU","PE","IL","IS","MA","AV","OM","IC","GH","DE","AI","CT","IG","ID"," OR","OV","UL","YO","BU","RA","FR","RO","WH","OT","BL","NT","UN","TR","HO","AC","TU","WE","CA","SH","UR","IE","PA","TO","EE","LI","RI","UG","AM","ND","US","LL","AS","TA","LE","MO","WO","MI","AB","EL","IA","NA","SS","AG","TT","NE","PL"," LA","OS","CE","DI","BE","AP","SI","NI","OW","SO","AK","CH","EM","IM","SE","NS","PO","EI","EX","KI","UC","AD","GR","IR","NG","OP","SP","OL","DA","NL","TL","LO","BO","RS","FE","FI","SU","GE","MP","UA","OO","RT","SA","CR","FF","IK","MB","KE","FA","CI","EQ","AF","ET","AY","MU","UE","HR","TW","GI","OI","VI","CU","FU","ED","QU","UT","RC","OF","CL","FT","IZ","PP","RG","DU","RM","YE","RL","DO","AU","EP","BA","JU","RD","RU","OG","BR","EF","KN","LS","GA","PI","YI","BI","IB","UB","VA","OC","IF","RN","RR","SC","TC","CK","DG","DR","MM","NN","OD","RV","UD","XP","JE","UM","EG","DL","PH","SL","GO","CC","LU","OA","PU","UI","YS","ZA","HU","MR","OE","SY","EO","TY","UP","FL","LM","NF","RP","OH","NU","XA","OB","VO","DM","GN"," LD","PT","SK","WR","JO","LT","YT","UF","BJ","DD","EY","GG","GL","GU","HT","LV","MS","NM","NV","OK","PM","RK","SW","TM","XC","ZE","AW","SM"}; - private static String[][][] NEXT_CHAR_LOOKUP = {{{"E","A","I","O","R"},{"E","O"}},{{"D","T","Y","C","S","G","N","I", "O","E","A","K"},{"D","T","Y","S","G","O","E","A","K"}},{{"G","T","E","D","S","C","A","I","K","V","U","N","F"},{"G","T","E","D","S","A","K"}},{{"N","U","R"},{"N","U","R"}},{{"T","C","D","S","E","I","G","O","N","A"},{"T","D","S","E","G","O","A"}},{{"O","N","C","V","M","L","E","T","S","A","R","F"},{"N","C","M","L","E","T","S","A","R","F"}},{{"R","U","O","L"},{"R","U","O","L"}},{{"R","N","Y","S","M","I","A","L","D","T"},{"R","N","Y","S","M","A","L","D","T"}},{{"T","D","V","N","S","R","P","L"},{"T","D","N","S","R","L"}},{{"S","N","C","M","L","P","G","T","R","E"},{"S","N","C","M","L","P","G","T","R","E"}},{{"R","D","N","S","M","L","E","C","A"},{"R","D","N","S","M","L","E","A"}},{{"I","E","T","H","U","O","C"},{"E","H","O"}},{{"E","S","I","A","N","Y","T","V","M","R","O","L","G","F","C"},{"E","S","A","N","Y","T","M"}},{{"L","S","I","T","E","U","O","M","K","F","A"},{"L","S","T","E","F"}},{{"S","Y","R","T","N","L"},{"S","Y","R","T","N","L"}},{{"R","N","L","S","D"},{"R","N","L","S","D"}},{{"N","M","U","R","L","V","S","O"},{"N","M","U","R","L","O"}},{{"S","A","D","N","E","C","L","T","P","M","V","G","F","Q"},{"S","A","D","N","E","L","T","P","M"}},{{"H","I","Y","E","S","T","A","U"},{"H","Y","E","S","A"}},{{"T","L","N","S"},{"T","L","N","S"}},{{"N","R","D","T","S","M","A"},{"N","R","D","T","S","M","A"}},{{"E","I","H","T","R","O","L"},{"E","H","T"}},{{"S","E","T","G","A","D","L","C","V","O","I","F"},{"S","E","T","G","A","D","O"}},{{"O","E","I","A"},{"E","A"}},{{"E","T","D","Y","S","I","R","L","M","K","G","A","O","N","C"},{"E","T","D","Y","S","M","K","A","N"}},{{"S","T","E","I","P","U","C"},{"S","T","E"}},{{"E","I"},{"E"}},{{"A","R","I","E","O","U","S"},{"A","E","O","S"}},{{"R","S","T","D","L","C","N","V","M","K"},{"R","S","T","D","L","N","M"}},{{"E","I","A"},{"E"}},{{"T","O","I","E","A","U","R","H"},{"T","E","H"}},{{"T","W","R","U","N","M"},{"T","W","R","U","N","M"}},{{"T","L","R","N","S","G","P","B"},{"T","L","R","N","S","P"}},{{"R","N","C","A","D","T","O"},{"R","N","A","D","T"}},{{"L","E","I","Y","D","A"},{"L","E","Y","D"}},{{"T","H","S","I","E","C","M"},{"T","H","S","E","M"}},{{"N","T","L","K","D","S","I","G"},{"N","T","L","D","S"}},{{"E","I","A"},{"E"}},{{"E","P","M","I","A"},{"E"}},{{"A","H","E","I","T","K","U","S"},{"H","E","T","K","S"}},{{"T"},{"T"}},{{"R","N","S","D","A","V","P","T","M","L","F"},{"R","N","S","D","A","P","T","M","L"}},{{"N","D","R","L","T"},{"N","D","R","L","T"}},{{"I","E","U","S","O"},{"E","S","O"}},{{"H","N","I"},{"H","N"}},{{"E"},{"E"}},{{"E","T","M","D","S","K","I","Y","L","G","A","R","N","C"},{"E","T","M","D","S","K","Y","A","N"}},{{"E","I"},{"E"}},{{"D","T","A","L"},{"D","T","L"}},{{"U"},{"U"}},{{"T","S","R","I"},{"T","S","R"}},{{"T","N","L","C","I","M","D","S","R","P","G","B"},{"T","N","L","M","D","S","R"}},{{"O","E","A"},{"E","A"}},{{"M","U","V","P","N","W","S","O","L","D","C","B","A","T","G"},{"M","U","P","N","W","O","L","D","T"}},{{"I","E","O","A"},{"E","O"}},{{"H","E","T","I"},{"H","E"}},{{"E","I","Y","O","A"},{"E","Y"}},{{"E","I","S","R","O","A","L","Y","U","H"},{"E","S","O","A","Y","H"}},{{"D","T","I","C","G"},{"D","T","G"}},{{"A","I","O","E","U","Y"},{"A","E","Y"}},{{"U","W","S","R","L","O","M","T","P","N","D"},{"U","W","R","L","O","M","T","P","N","D"}},{{"T","E","K","H","C","R","I"},{"T","E","K","H"}},{{"R","D","A","T"},{"R","T"}},{{"R","L","E","V","S","N","A"},{"R","L","E","S","N","A"}},{{"L","N","T","R","U","S","M","P"},{"L","N","T","R","S","M"}},{{"E","O","I","A"},{"E","O"}},{{"E","N","T","S","I","A","Y","R","P","C"},{"E","N","T","S","A","Y"}},{{"S","N","D","T","W","V","R","L","F"},{"S","N","D","T","W","R","L"}},{{"R","T","S","N","L","I","C"},{"R","T","S","N","L"}},{{"R","O","N","W","P","M","L"},{"R","O","N","W","P","M","L"}},{{"N","D","T","M","S","R","P","L","K"},{"N","D","T","M","S","R","P","L","K"}},{{"N","T","S","C","K","G","E","F","Z","V","O","M","A"},{"N","T","S","C","G","E","F","M","A"}},{{"N","E","C","T","S","G","A","V","O","P","M","L","D","B"},{"N","E","C","T","S","G","A","P","M","L","D"}},{{"H","G"},{"H"}},{{"E","P","I","O","A"},{"E"}},{{"E","I","S","A","U","O"},{"E","S","O"}},{{"E","T","I","S","L","H"},{"E","T","S","H"}},{{"Y","E","O","I","S","A"},{"Y","E","S"}},{{"T","S","E","I","U","O","K","H"},{"T","S","E","O","H"}},{{"T","N","L","I","R","K","B","G","C"},{"T","N","L","R"}},{{"S","D","A","T","C","R","N","M","G","V","F"},{"S","D","A","T","R","N","M"}},{{"R","S","V","T","U","D"},{"R","T","U","D"}},{{"R","U"},{"R","U"}},{{"N","L","S","T","C","G"},{"N","L","S","T","C","G"}},{{"L","O","I"},{}},{{"L","Y","I","E","F","O","A","T","S","P","D"},{"L","Y","E","F","T","S","D"}},{{"L","N","T"},{"L","N","T"}},{{"L","T","R","N","M"},{"L","T","R","N","M"}},{{"I","E","U","O","A"},{"E","O"}},{{"E","A","O"},{"E","O"}},{{"E","L","I"},{"E"}},{{"D","S","W","R","E","Y","V","T","L","C","A"},{"D","S","W","R","E","Y","T","L","A"}},{{"A","E","I","Y","O"},{"E","Y"}},{{"T","N","R","S","C","Y","W","I","B"},{"T","N","R","S","Y","W"}},{{"T","E","S","I"},{"T","E","S"}},{{"S","N","R","D","P","L","I"},{"S","N","R","D","P","L"}},{{"S","N","T","D","F","E","C","A","V","R"},{"S","N","T","D","F","E","C","A","R"}},{{"R","E","C","T","L","F","S","I","G","D","A"},{"R","E","T","L","S","D","A"}},{{"P","E","A"},{"E"}},{{"O","N","D","T","S","G","C","B","V","M","A"},{"N","D","T","S","G","C","M","A"}},{{"N","T","S","C","Z","O","G","F"},{"N","T","S","C","G","F"}},{{"N","E","S","I","A"},{"N","E","S"}},{{"N","M","U","L","C","R"},{"N","M","U","L","R"}},{{"E","I"},{"E"}},{{"E","A","I","O","U","R"},{"E","O"}},{{"E","S","P","O","B","A","I"},{"E","S"}},{{"E","P","I","A","S","M"},{"E","S"}},{{"D","N","L","S","R","E","C","T","V","A"},{"D","N","L","S","R","E","T","A"}},{{"T","I","E"},{"T","E"}},{{"S","R","N","L","W","T","I"},{"R","N","L","W","T"}},{{"R","N","G","T"},{"R","N","G","T"}},{{"P","T","I","C","A"},{"T"}},{{"N"},{"N"}},{{"H","T","K","E"},{"H","T","K","E"}},{{"E","I","Y","V","M","D"},{"E","Y"}},{{"E","A","O"},{"E","A"}},{{"E","S","T","L","I"},{"E","S","T"}},{{"E","S","L","T","R","I"},{"E","S"}},{{"E","P","L"},{"E"}},{{"E","O","I","A"},{"E"}},{{"D","L","I","O","E","U"},{"D","L","E"}},{{"Y","T","R","N"},{"Y","T","R","N"}},{{"Y"},{"Y"}},{{"Y","E"},{"Y","E"}},{{"W","N","O","S","C","V","U","T","R","P","G"},{"W","N","O","U","T","R","P"}},{{"U","T","R","O","D","A"},{"U","T","R","O","D"}},{{"T","E","O","I"},{"T","E","O"}},{{"R","E","W","L","C","A"},{"R","E","W","L","A"}},{{"R","N","C","E","L","G"},{"R","N","C","E","L","G"}},{{"R","C","P","B","M","L","A"},{"R","P","M","L"}},{{"N","T","S","R","D"},{"N","T","S","R","D"}},{{"L","O","A","T","R","E"},{"T","E"}},{{"L","T","R"},{"L","T","R"}},{{"K","D","L","T","R","N","M"},{"K","D","L","T","R","N","M"}},{{"I","H","A","E","Y","U","S"},{"H","A","E","Y","S"}},{{"I","M","Y","N","L"},{"M","Y","N","L"}},{{"E","I","O","A"},{"E","A"}},{{"E","I"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"D","N","T","S","R","E"},{"D","N","T","S","R","E"}},{{"C","R","M","I"},{"R","M"}},{{"A","T","E","S","P","N"},{"A","T","E","S","P","N"}},{{"U"},{}},{{"T","F"},{"T","F"}},{{"T","I","H","E","Y","W","S","A"},{"H","E","Y","S","A"}},{{"S","E"},{"S"}},{{"S","N","L","C"},{"S","N","L"}},{{"S","N"},{"S","N"}},{{"O","E","I"},{"E"}},{{"O","E"},{"O","E"}},{{"N","V","O","C"},{"N","C"}},{{"N"},{"N"}},{{"N","D","S","C","T","O","L","E"},{"N","D","S","C","T","L","E"}},{{"L","R","T","S"},{"L","R","T","S"}},{{"L","R","N"},{"L","R","N"}},{{"I","U","E"},{"E"}},{{"I","E","A"},{"E"}},{{"I","H","E"},{"H","E"}},{{"H","E"},{"H","E"}},{{"F","T"},{"F","T"}},{{"E","A","U","O"},{"E"}},{{"E"},{"E"}},{{"E","A"},{"E"}},{{"E","O","R","L"},{"E"}},{{"E","A"},{"E"}},{{"C","S","R","A"},{"S","R"}},{{"A","S","I","E"},{"S","E"}},{{"A","S","D"},{"A","S","D"}},{{"Y","D"},{"Y","D"}},{{"W","N","M","E"},{"W","N","M"}},{{"T","S"},{"T","S"}},{{"T","O","E","A"},{"T","E"}},{{"S","C","R","N","L"},{"S","R","N","L"}},{{"S"},{"S"}},{{"S","E","I"},{"S","E"}},{{"S","N","C"},{"S","N"}},{{"R","I"},{}},{{"O","I","E","A"},{"E","A"}},{{"O","F","U","T","E"},{"F","T","E"}},{{"O","E"},{"O","E"}},{{"O"},{"O"}},{{"N","I","T","R"},{"N","T","R"}},{{"N","T","R","E","C"},{"N","T","R","E","C"}},{{"N"},{"N"}},{{"L","T","N"},{"L","T","N"}},{{"L","I","E"},{"E"}},{{"L"},{}},{{"L","T","R","N"},{"L","T","R","N"}},{{"K","I","E","C","A"},{"K","E"}},{{"I","F","E","T"},{"F","E","T"}},{{"I","E","M","A"},{"E","A"}},{{"I","E","Y","O"},{"E","Y"}},{{"H","R","O","I","A"},{"H"}},{{"H"},{"H"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E","O","I","A"},{"E","A"}},{{"E","U","I"},{"E"}},{{"E","O","I"},{"E","O"}},{{"E","Y","U"},{"E","Y"}},{{"E","I"},{"E"}},{{"E","I"},{"E"}},{{"E"},{"E"}},{{"C"},{}},{{"B","E"},{"E"}},{{"A","R","I","E"},{"E"}},{{"Y","E"},{"Y","E"}},{{"Y","O","I","E"},{"Y","O","E"}},{{"Y","A"},{"Y"}},{{"V","T","O"},{"T","O"}},{{"U","O","E"},{"E"}},{{"T","S","M","E","D"},{"T","S","M","E"}},{{"T","R","D"},{"T","R","D"}},{{"T","R","L","B"},{"T","R","L"}},{{"T","R","L"},{"T","R","L"}},{{"T"},{"T"}},{{"T"},{"T"}},{{"S","R","N","M"},{"S","R","N","M"}},{{"S"},{"S"}},{{"S"},{"S"}},{{"S"},{"S"}},{{"R","P"},{"R","P"}},{{"P"},{}},{{"P","O"},{}},{{"O","E"},{"E"}},{{"O"},{}},{{"O"},{}},{{"O"},{}},{{"N"},{}},{{"M"},{"M"}},{{"M"},{"M"}},{{"L"},{}},{{"L"},{"L"}},{{"I"},{}},{{"I"},{}},{{"I","E"},{"E"}},{{"I"},{}},{{"I","E"},{"E"}},{{"I"},{}},{{"H"},{}},{{"H","E"},{"H","E"}},{{"H"},{"H"}},{{"F"},{"F"}},{{"E"},{}},{{"E"},{"E"}},{{"E"},{}},{{"E"},{"E"}},{{"E","A"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"D"},{"D"}},{{"A"},{}},{{"A"},{}}}; + private static final String[] START_BIGRAM = {"TH","OF","AN","IN","TO","CO","BE","HE","RE","HA","WA","FO","WH","MA","WI", "ON","HI","PR","ST","NO","IS","IT","SE","WE","AS","CA","DE","SO","MO","SH","DI","AL","AR","LI","WO","FR","PA","ME","AT","SU","BU","SA","FI","NE","CH","PO","HO","DO","OR","UN","LO","EX","BY","FA","LA","LE","PE","MI","SI","YO","TR","BA","GO","BO","GR","TE","EN","OU","RA","AC","FE","PL","CL","SP","BR","EV","TA","DA","AB","TI","RO","MU","EA","NA","SC","AD","GE","YE","AF","AG","UP","AP","DR","US","PU","CE","IF","RI","VI","IM","AM","KN","OP","CR","OT","JU","QU","TW","GA","VA","VE","PI","GI","BI","FL","BL","EL","JO","FU","HU","CU","RU","OV","OB","KE","EF","PH","CI","KI","NI","SL","EM","SM","VO","MR","WR","ES","DU","TU","AU","NU","GU","OW","SY","OC","EC","ED","ID","JE","AI","EI","SK","OL","GL","EQ","LU","AV","SW","AW","EY","TY"}; + private static final String[] LOOKUP_BIGRAM = {"TH","AN","IN","IO","EN","TI","FO","HE","HA","HI","TE","AT","ER","AL","WA", "VE","CO","RE","IT","WI","ME","NC","ON","PR","AR","ES","EV","ST","EA","IV","EC","NO","OU","PE","IL","IS","MA","AV","OM","IC","GH","DE","AI","CT","IG","ID"," OR","OV","UL","YO","BU","RA","FR","RO","WH","OT","BL","NT","UN","TR","HO","AC","TU","WE","CA","SH","UR","IE","PA","TO","EE","LI","RI","UG","AM","ND","US","LL","AS","TA","LE","MO","WO","MI","AB","EL","IA","NA","SS","AG","TT","NE","PL"," LA","OS","CE","DI","BE","AP","SI","NI","OW","SO","AK","CH","EM","IM","SE","NS","PO","EI","EX","KI","UC","AD","GR","IR","NG","OP","SP","OL","DA","NL","TL","LO","BO","RS","FE","FI","SU","GE","MP","UA","OO","RT","SA","CR","FF","IK","MB","KE","FA","CI","EQ","AF","ET","AY","MU","UE","HR","TW","GI","OI","VI","CU","FU","ED","QU","UT","RC","OF","CL","FT","IZ","PP","RG","DU","RM","YE","RL","DO","AU","EP","BA","JU","RD","RU","OG","BR","EF","KN","LS","GA","PI","YI","BI","IB","UB","VA","OC","IF","RN","RR","SC","TC","CK","DG","DR","MM","NN","OD","RV","UD","XP","JE","UM","EG","DL","PH","SL","GO","CC","LU","OA","PU","UI","YS","ZA","HU","MR","OE","SY","EO","TY","UP","FL","LM","NF","RP","OH","NU","XA","OB","VO","DM","GN"," LD","PT","SK","WR","JO","LT","YT","UF","BJ","DD","EY","GG","GL","GU","HT","LV","MS","NM","NV","OK","PM","RK","SW","TM","XC","ZE","AW","SM"}; + private static final String[][][] NEXT_CHAR_LOOKUP = {{{"E","A","I","O","R"},{"E","O"}},{{"D","T","Y","C","S","G","N","I", "O","E","A","K"},{"D","T","Y","S","G","O","E","A","K"}},{{"G","T","E","D","S","C","A","I","K","V","U","N","F"},{"G","T","E","D","S","A","K"}},{{"N","U","R"},{"N","U","R"}},{{"T","C","D","S","E","I","G","O","N","A"},{"T","D","S","E","G","O","A"}},{{"O","N","C","V","M","L","E","T","S","A","R","F"},{"N","C","M","L","E","T","S","A","R","F"}},{{"R","U","O","L"},{"R","U","O","L"}},{{"R","N","Y","S","M","I","A","L","D","T"},{"R","N","Y","S","M","A","L","D","T"}},{{"T","D","V","N","S","R","P","L"},{"T","D","N","S","R","L"}},{{"S","N","C","M","L","P","G","T","R","E"},{"S","N","C","M","L","P","G","T","R","E"}},{{"R","D","N","S","M","L","E","C","A"},{"R","D","N","S","M","L","E","A"}},{{"I","E","T","H","U","O","C"},{"E","H","O"}},{{"E","S","I","A","N","Y","T","V","M","R","O","L","G","F","C"},{"E","S","A","N","Y","T","M"}},{{"L","S","I","T","E","U","O","M","K","F","A"},{"L","S","T","E","F"}},{{"S","Y","R","T","N","L"},{"S","Y","R","T","N","L"}},{{"R","N","L","S","D"},{"R","N","L","S","D"}},{{"N","M","U","R","L","V","S","O"},{"N","M","U","R","L","O"}},{{"S","A","D","N","E","C","L","T","P","M","V","G","F","Q"},{"S","A","D","N","E","L","T","P","M"}},{{"H","I","Y","E","S","T","A","U"},{"H","Y","E","S","A"}},{{"T","L","N","S"},{"T","L","N","S"}},{{"N","R","D","T","S","M","A"},{"N","R","D","T","S","M","A"}},{{"E","I","H","T","R","O","L"},{"E","H","T"}},{{"S","E","T","G","A","D","L","C","V","O","I","F"},{"S","E","T","G","A","D","O"}},{{"O","E","I","A"},{"E","A"}},{{"E","T","D","Y","S","I","R","L","M","K","G","A","O","N","C"},{"E","T","D","Y","S","M","K","A","N"}},{{"S","T","E","I","P","U","C"},{"S","T","E"}},{{"E","I"},{"E"}},{{"A","R","I","E","O","U","S"},{"A","E","O","S"}},{{"R","S","T","D","L","C","N","V","M","K"},{"R","S","T","D","L","N","M"}},{{"E","I","A"},{"E"}},{{"T","O","I","E","A","U","R","H"},{"T","E","H"}},{{"T","W","R","U","N","M"},{"T","W","R","U","N","M"}},{{"T","L","R","N","S","G","P","B"},{"T","L","R","N","S","P"}},{{"R","N","C","A","D","T","O"},{"R","N","A","D","T"}},{{"L","E","I","Y","D","A"},{"L","E","Y","D"}},{{"T","H","S","I","E","C","M"},{"T","H","S","E","M"}},{{"N","T","L","K","D","S","I","G"},{"N","T","L","D","S"}},{{"E","I","A"},{"E"}},{{"E","P","M","I","A"},{"E"}},{{"A","H","E","I","T","K","U","S"},{"H","E","T","K","S"}},{{"T"},{"T"}},{{"R","N","S","D","A","V","P","T","M","L","F"},{"R","N","S","D","A","P","T","M","L"}},{{"N","D","R","L","T"},{"N","D","R","L","T"}},{{"I","E","U","S","O"},{"E","S","O"}},{{"H","N","I"},{"H","N"}},{{"E"},{"E"}},{{"E","T","M","D","S","K","I","Y","L","G","A","R","N","C"},{"E","T","M","D","S","K","Y","A","N"}},{{"E","I"},{"E"}},{{"D","T","A","L"},{"D","T","L"}},{{"U"},{"U"}},{{"T","S","R","I"},{"T","S","R"}},{{"T","N","L","C","I","M","D","S","R","P","G","B"},{"T","N","L","M","D","S","R"}},{{"O","E","A"},{"E","A"}},{{"M","U","V","P","N","W","S","O","L","D","C","B","A","T","G"},{"M","U","P","N","W","O","L","D","T"}},{{"I","E","O","A"},{"E","O"}},{{"H","E","T","I"},{"H","E"}},{{"E","I","Y","O","A"},{"E","Y"}},{{"E","I","S","R","O","A","L","Y","U","H"},{"E","S","O","A","Y","H"}},{{"D","T","I","C","G"},{"D","T","G"}},{{"A","I","O","E","U","Y"},{"A","E","Y"}},{{"U","W","S","R","L","O","M","T","P","N","D"},{"U","W","R","L","O","M","T","P","N","D"}},{{"T","E","K","H","C","R","I"},{"T","E","K","H"}},{{"R","D","A","T"},{"R","T"}},{{"R","L","E","V","S","N","A"},{"R","L","E","S","N","A"}},{{"L","N","T","R","U","S","M","P"},{"L","N","T","R","S","M"}},{{"E","O","I","A"},{"E","O"}},{{"E","N","T","S","I","A","Y","R","P","C"},{"E","N","T","S","A","Y"}},{{"S","N","D","T","W","V","R","L","F"},{"S","N","D","T","W","R","L"}},{{"R","T","S","N","L","I","C"},{"R","T","S","N","L"}},{{"R","O","N","W","P","M","L"},{"R","O","N","W","P","M","L"}},{{"N","D","T","M","S","R","P","L","K"},{"N","D","T","M","S","R","P","L","K"}},{{"N","T","S","C","K","G","E","F","Z","V","O","M","A"},{"N","T","S","C","G","E","F","M","A"}},{{"N","E","C","T","S","G","A","V","O","P","M","L","D","B"},{"N","E","C","T","S","G","A","P","M","L","D"}},{{"H","G"},{"H"}},{{"E","P","I","O","A"},{"E"}},{{"E","I","S","A","U","O"},{"E","S","O"}},{{"E","T","I","S","L","H"},{"E","T","S","H"}},{{"Y","E","O","I","S","A"},{"Y","E","S"}},{{"T","S","E","I","U","O","K","H"},{"T","S","E","O","H"}},{{"T","N","L","I","R","K","B","G","C"},{"T","N","L","R"}},{{"S","D","A","T","C","R","N","M","G","V","F"},{"S","D","A","T","R","N","M"}},{{"R","S","V","T","U","D"},{"R","T","U","D"}},{{"R","U"},{"R","U"}},{{"N","L","S","T","C","G"},{"N","L","S","T","C","G"}},{{"L","O","I"},{}},{{"L","Y","I","E","F","O","A","T","S","P","D"},{"L","Y","E","F","T","S","D"}},{{"L","N","T"},{"L","N","T"}},{{"L","T","R","N","M"},{"L","T","R","N","M"}},{{"I","E","U","O","A"},{"E","O"}},{{"E","A","O"},{"E","O"}},{{"E","L","I"},{"E"}},{{"D","S","W","R","E","Y","V","T","L","C","A"},{"D","S","W","R","E","Y","T","L","A"}},{{"A","E","I","Y","O"},{"E","Y"}},{{"T","N","R","S","C","Y","W","I","B"},{"T","N","R","S","Y","W"}},{{"T","E","S","I"},{"T","E","S"}},{{"S","N","R","D","P","L","I"},{"S","N","R","D","P","L"}},{{"S","N","T","D","F","E","C","A","V","R"},{"S","N","T","D","F","E","C","A","R"}},{{"R","E","C","T","L","F","S","I","G","D","A"},{"R","E","T","L","S","D","A"}},{{"P","E","A"},{"E"}},{{"O","N","D","T","S","G","C","B","V","M","A"},{"N","D","T","S","G","C","M","A"}},{{"N","T","S","C","Z","O","G","F"},{"N","T","S","C","G","F"}},{{"N","E","S","I","A"},{"N","E","S"}},{{"N","M","U","L","C","R"},{"N","M","U","L","R"}},{{"E","I"},{"E"}},{{"E","A","I","O","U","R"},{"E","O"}},{{"E","S","P","O","B","A","I"},{"E","S"}},{{"E","P","I","A","S","M"},{"E","S"}},{{"D","N","L","S","R","E","C","T","V","A"},{"D","N","L","S","R","E","T","A"}},{{"T","I","E"},{"T","E"}},{{"S","R","N","L","W","T","I"},{"R","N","L","W","T"}},{{"R","N","G","T"},{"R","N","G","T"}},{{"P","T","I","C","A"},{"T"}},{{"N"},{"N"}},{{"H","T","K","E"},{"H","T","K","E"}},{{"E","I","Y","V","M","D"},{"E","Y"}},{{"E","A","O"},{"E","A"}},{{"E","S","T","L","I"},{"E","S","T"}},{{"E","S","L","T","R","I"},{"E","S"}},{{"E","P","L"},{"E"}},{{"E","O","I","A"},{"E"}},{{"D","L","I","O","E","U"},{"D","L","E"}},{{"Y","T","R","N"},{"Y","T","R","N"}},{{"Y"},{"Y"}},{{"Y","E"},{"Y","E"}},{{"W","N","O","S","C","V","U","T","R","P","G"},{"W","N","O","U","T","R","P"}},{{"U","T","R","O","D","A"},{"U","T","R","O","D"}},{{"T","E","O","I"},{"T","E","O"}},{{"R","E","W","L","C","A"},{"R","E","W","L","A"}},{{"R","N","C","E","L","G"},{"R","N","C","E","L","G"}},{{"R","C","P","B","M","L","A"},{"R","P","M","L"}},{{"N","T","S","R","D"},{"N","T","S","R","D"}},{{"L","O","A","T","R","E"},{"T","E"}},{{"L","T","R"},{"L","T","R"}},{{"K","D","L","T","R","N","M"},{"K","D","L","T","R","N","M"}},{{"I","H","A","E","Y","U","S"},{"H","A","E","Y","S"}},{{"I","M","Y","N","L"},{"M","Y","N","L"}},{{"E","I","O","A"},{"E","A"}},{{"E","I"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"D","N","T","S","R","E"},{"D","N","T","S","R","E"}},{{"C","R","M","I"},{"R","M"}},{{"A","T","E","S","P","N"},{"A","T","E","S","P","N"}},{{"U"},{}},{{"T","F"},{"T","F"}},{{"T","I","H","E","Y","W","S","A"},{"H","E","Y","S","A"}},{{"S","E"},{"S"}},{{"S","N","L","C"},{"S","N","L"}},{{"S","N"},{"S","N"}},{{"O","E","I"},{"E"}},{{"O","E"},{"O","E"}},{{"N","V","O","C"},{"N","C"}},{{"N"},{"N"}},{{"N","D","S","C","T","O","L","E"},{"N","D","S","C","T","L","E"}},{{"L","R","T","S"},{"L","R","T","S"}},{{"L","R","N"},{"L","R","N"}},{{"I","U","E"},{"E"}},{{"I","E","A"},{"E"}},{{"I","H","E"},{"H","E"}},{{"H","E"},{"H","E"}},{{"F","T"},{"F","T"}},{{"E","A","U","O"},{"E"}},{{"E"},{"E"}},{{"E","A"},{"E"}},{{"E","O","R","L"},{"E"}},{{"E","A"},{"E"}},{{"C","S","R","A"},{"S","R"}},{{"A","S","I","E"},{"S","E"}},{{"A","S","D"},{"A","S","D"}},{{"Y","D"},{"Y","D"}},{{"W","N","M","E"},{"W","N","M"}},{{"T","S"},{"T","S"}},{{"T","O","E","A"},{"T","E"}},{{"S","C","R","N","L"},{"S","R","N","L"}},{{"S"},{"S"}},{{"S","E","I"},{"S","E"}},{{"S","N","C"},{"S","N"}},{{"R","I"},{}},{{"O","I","E","A"},{"E","A"}},{{"O","F","U","T","E"},{"F","T","E"}},{{"O","E"},{"O","E"}},{{"O"},{"O"}},{{"N","I","T","R"},{"N","T","R"}},{{"N","T","R","E","C"},{"N","T","R","E","C"}},{{"N"},{"N"}},{{"L","T","N"},{"L","T","N"}},{{"L","I","E"},{"E"}},{{"L"},{}},{{"L","T","R","N"},{"L","T","R","N"}},{{"K","I","E","C","A"},{"K","E"}},{{"I","F","E","T"},{"F","E","T"}},{{"I","E","M","A"},{"E","A"}},{{"I","E","Y","O"},{"E","Y"}},{{"H","R","O","I","A"},{"H"}},{{"H"},{"H"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E","O","I","A"},{"E","A"}},{{"E","U","I"},{"E"}},{{"E","O","I"},{"E","O"}},{{"E","Y","U"},{"E","Y"}},{{"E","I"},{"E"}},{{"E","I"},{"E"}},{{"E"},{"E"}},{{"C"},{}},{{"B","E"},{"E"}},{{"A","R","I","E"},{"E"}},{{"Y","E"},{"Y","E"}},{{"Y","O","I","E"},{"Y","O","E"}},{{"Y","A"},{"Y"}},{{"V","T","O"},{"T","O"}},{{"U","O","E"},{"E"}},{{"T","S","M","E","D"},{"T","S","M","E"}},{{"T","R","D"},{"T","R","D"}},{{"T","R","L","B"},{"T","R","L"}},{{"T","R","L"},{"T","R","L"}},{{"T"},{"T"}},{{"T"},{"T"}},{{"S","R","N","M"},{"S","R","N","M"}},{{"S"},{"S"}},{{"S"},{"S"}},{{"S"},{"S"}},{{"R","P"},{"R","P"}},{{"P"},{}},{{"P","O"},{}},{{"O","E"},{"E"}},{{"O"},{}},{{"O"},{}},{{"O"},{}},{{"N"},{}},{{"M"},{"M"}},{{"M"},{"M"}},{{"L"},{}},{{"L"},{"L"}},{{"I"},{}},{{"I"},{}},{{"I","E"},{"E"}},{{"I"},{}},{{"I","E"},{"E"}},{{"I"},{}},{{"H"},{}},{{"H","E"},{"H","E"}},{{"H"},{"H"}},{{"F"},{"F"}},{{"E"},{}},{{"E"},{"E"}},{{"E"},{}},{{"E"},{"E"}},{{"E","A"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"E"},{"E"}},{{"D"},{"D"}},{{"A"},{}},{{"A"},{}}}; //----------------------------------------------------------------------------------------- - private Random generator = new Random(); + private final Random generator = new Random(); /** * Default, no argument constructor