diff --git a/build/classes/random/text/generator/Gui$1.class b/build/classes/random/text/generator/Gui$1.class new file mode 100644 index 0000000..2cb0a3e Binary files /dev/null and b/build/classes/random/text/generator/Gui$1.class differ diff --git a/build/classes/random/text/generator/Gui.class b/build/classes/random/text/generator/Gui.class new file mode 100644 index 0000000..60e263c Binary files /dev/null and b/build/classes/random/text/generator/Gui.class differ diff --git a/build/classes/random/text/generator/RandomTextGenerator.class b/build/classes/random/text/generator/RandomTextGenerator.class index 63b7168..0fd006a 100644 Binary files a/build/classes/random/text/generator/RandomTextGenerator.class and b/build/classes/random/text/generator/RandomTextGenerator.class differ diff --git a/build/classes/random/text/generator/SpaceEfficientGenerator.class b/build/classes/random/text/generator/SpaceEfficientGenerator.class index 41775ae..e158e81 100644 Binary files a/build/classes/random/text/generator/SpaceEfficientGenerator.class and b/build/classes/random/text/generator/SpaceEfficientGenerator.class differ diff --git a/build/classes/random/text/generator/SpeedEfficientGenerator.class b/build/classes/random/text/generator/SpeedEfficientGenerator.class index 58b6dfb..8a9b6a1 100644 Binary files a/build/classes/random/text/generator/SpeedEfficientGenerator.class and b/build/classes/random/text/generator/SpeedEfficientGenerator.class differ diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties index 08bbc8d..50acb60 100644 --- a/nbproject/private/private.properties +++ b/nbproject/private/private.properties @@ -1,2 +1,2 @@ compile.on.save=true -user.properties.file=C:\\Users\\Ma Jing\\AppData\\Roaming\\NetBeans\\8.1\\build.properties +user.properties.file=C:\\Users\\Work\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties diff --git a/src/random/text/generator/RandomTextGenerator.java b/src/random/text/generator/RandomTextGenerator.java index 7088860..acff3b5 100644 --- a/src/random/text/generator/RandomTextGenerator.java +++ b/src/random/text/generator/RandomTextGenerator.java @@ -10,7 +10,21 @@ * to form a new text. This technique is called the Markov chain. */ public abstract class RandomTextGenerator { - + protected static final String defaultText = "She is into superstitions, black cats and voodoo dolls. " + + "I feel a premonition that girl is gonna make me fall. " + + "She is into new sensations, new kicks in the candle light. " + + "She has got a new addiction for every day and night. " + + "She will make you take your clothes off and go dancing in the rain. " + + "She will make you live her crazy life but she will take away your pain like a bullet to your brain. " + + "Come On! Upside, inside out she is livin la vida loca. " + + "She will push and pull you down, livin la vida loca. " + + "Her lips are devil red and her skin is the color mocha. " + + "She will wear you out livin la vida loca. Come On! Livin la vida loca, Come on! " + + "She is livin la vida loca. Woke up in New York City in a funky cheap hotel. " + + "She took my heart and she took my money. She must have slipped me a sleeping pill. " + + "She never drinks the water and makes you order French Champagne. " + + "Once you have had a taste of her you will never be the same. " + + "Yeah, she will make you go insane."; public final String[] text; public final int SETSIZE = 3; @@ -18,6 +32,10 @@ public RandomTextGenerator(String text) { this.text = text.split("\\s+"); } + public static String getDefaultText(){ + return defaultText; + } + public String generateText(int wordAmount) { if (wordAmount <= SETSIZE) return null; diff --git a/src/random/text/generator/SpaceEfficientGenerator.java b/src/random/text/generator/SpaceEfficientGenerator.java index 6a41e3f..3ae39f8 100644 --- a/src/random/text/generator/SpaceEfficientGenerator.java +++ b/src/random/text/generator/SpaceEfficientGenerator.java @@ -34,21 +34,6 @@ public ArrayList getFollowingWords(WordSet set) { * @param args the command line arguments */ public static void main(String[] args) { - final String defaultText = "She is into superstitions, black cats and voodoo dolls. " - + "I feel a premonition that girl is gonna make me fall. " - + "She is into new sensations, new kicks in the candle light. " - + "She has got a new addiction for every day and night. " - + "She will make you take your clothes off and go dancing in the rain. " - + "She will make you live her crazy life but she will take away your pain like a bullet to your brain. " - + "Come On! Upside, inside out she is livin la vida loca. " - + "She will push and pull you down, livin la vida loca. " - + "Her lips are devil red and her skin is the color mocha. " - + "She will wear you out livin la vida loca. Come On! Livin la vida loca, Come on! " - + "She is livin la vida loca. Woke up in New York City in a funky cheap hotel. " - + "She took my heart and she took my money. She must have slipped me a sleeping pill. " - + "She never drinks the water and makes you order French Champagne. " - + "Once you have had a taste of her you will never be the same. " - + "Yeah, she will make you go insane."; SpaceEfficientGenerator gen = new SpaceEfficientGenerator(defaultText); System.out.println(gen.generateText(100)); } diff --git a/src/random/text/generator/SpeedEfficientGenerator.java b/src/random/text/generator/SpeedEfficientGenerator.java index 66e973c..bbf1076 100644 --- a/src/random/text/generator/SpeedEfficientGenerator.java +++ b/src/random/text/generator/SpeedEfficientGenerator.java @@ -52,21 +52,6 @@ public ArrayList getFollowingWords(WordSet set) { * @param args the command line arguments */ public static void main(String[] args) { - final String defaultText = "She is into superstitions, black cats and voodoo dolls. " - + "I feel a premonition that girl is gonna make me fall. " - + "She is into new sensations, new kicks in the candle light. " - + "She has got a new addiction for every day and night. " - + "She will make you take your clothes off and go dancing in the rain. " - + "She will make you live her crazy life but she will take away your pain like a bullet to your brain. " - + "Come On! Upside, inside out she is livin la vida loca. " - + "She will push and pull you down, livin la vida loca. " - + "Her lips are devil red and her skin is the color mocha. " - + "She will wear you out livin la vida loca. Come On! Livin la vida loca, Come on! " - + "She is livin la vida loca. Woke up in New York City in a funky cheap hotel. " - + "She took my heart and she took my money. She must have slipped me a sleeping pill. " - + "She never drinks the water and makes you order French Champagne. " - + "Once you have had a taste of her you will never be the same. " - + "Yeah, she will make you go insane."; SpeedEfficientGenerator gen = new SpeedEfficientGenerator(defaultText); // Uncomment the line below to print all the WordSets and their following words // gen.printWordMap();