src/textgen/MarkovTextGeneratorLoL.java
/**
	 * This is a minimal set of tests.  Note that it can be difficult
	 * to test methods/classes with randomized behavior.   
	 * @param args
	 */
This is a minimal set of tests.  Note that it can be difficult
to test methods/classes with randomized behavior.
@param args
This is a minimal set of tests . Note that it can be difficult to test methods / classes with randomized behavior . @param args
public static void main(String[] args)
	{
		MarkovTextGeneratorLoL gen = new MarkovTextGeneratorLoL(new Random(42));
		String textString2 = "Hello.  Hello there.  This is a test.  Hello there.  Hello Bob.  Test again.";
		System.out.println(textString2);
		gen.train(textString2);
		System.out.println(gen);
		System.out.println(gen.generateText(10));
		String textString3 = "You say yes, I say no, "+
				"You say stop, and I say go, go, go, "+
				"Oh no. You say goodbye and I say hello, hello, hello, "+
				"I don't know why you say goodbye, I say hello, hello, hello, "+
				"I don't know why you say goodbye, I say hello. "+
				"I say high, you say low, "+
				"You say why, and I say I don't know. "+
				"Oh no. "+
				"You say goodbye and I say hello, hello, hello. "+
				"I don't know why you say goodbye, I say hello, hello, hello, "+
				"I don't know why you say goodbye, I say hello. "+
				"Why, why, why, why, why, why, "+
				"Do you say goodbye. "+
				"Oh no. "+
				"You say goodbye and I say hello, hello, hello. "+
				"I don't know why you say goodbye, I say hello, hello, hello, "+
				"I don't know why you say goodbye, I say hello. "+
				"You say yes, I say no, "+
				"You say stop and I say go, go, go. "+
				"Oh, oh no. "+
				"You say goodbye and I say hello, hello, hello. "+
				"I don't know why you say goodbye, I say hello, hello, hello, "+
				"I don't know why you say goodbye, I say hello, hello, hello, "+
				"I don't know why you say goodbye, I say hello, hello, hello,";
		System.out.println(textString3);
		gen.retrain(textString3);
		System.out.println(gen);
		System.out.println(gen.generateText(20));
	}
public static void main ( String [ ] args ) { MarkovTextGeneratorLoL gen = new MarkovTextGeneratorLoL ( new Random ( 42 ) ) ; String textString2 = "Hello.  Hello there.  This is a test.  Hello there.  Hello Bob.  Test again." ; System . out . println ( textString2 ) ; gen . train ( textString2 ) ; System . out . println ( gen ) ; System . out . println ( gen . generateText ( 10 ) ) ; String textString3 = "You say yes, I say no, " + "You say stop, and I say go, go, go, " + "Oh no. You say goodbye and I say hello, hello, hello, " + "I don't know why you say goodbye, I say hello, hello, hello, " + "I don't know why you say goodbye, I say hello. " + "I say high, you say low, " + "You say why, and I say I don't know. " + "Oh no. " + "You say goodbye and I say hello, hello, hello. " + "I don't know why you say goodbye, I say hello, hello, hello, " + "I don't know why you say goodbye, I say hello. " + "Why, why, why, why, why, why, " + "Do you say goodbye. " + "Oh no. " + "You say goodbye and I say hello, hello, hello. " + "I don't know why you say goodbye, I say hello, hello, hello, " + "I don't know why you say goodbye, I say hello. " + "You say yes, I say no, " + "You say stop and I say go, go, go. " + "Oh, oh no. " + "You say goodbye and I say hello, hello, hello. " + "I don't know why you say goodbye, I say hello, hello, hello, " + "I don't know why you say goodbye, I say hello, hello, hello, " + "I don't know why you say goodbye, I say hello, hello, hello," ; System . out . println ( textString3 ) ; gen . retrain ( textString3 ) ; System . out . println ( gen ) ; System . out . println ( gen . generateText ( 20 ) ) ; }
This is a minimal set of tests.
This is a minimal set of tests .
// feed the generator a fixed random value for repeatable behavior //String textString2 = "hi there hi Leo";