Java program that analyzes an input text for patterns and uses these patterns to generate a random output text