From e1e2df45dbbb7682e869224d525875dd99c60643 Mon Sep 17 00:00:00 2001 From: Yash Ugrankar Date: Sat, 29 Oct 2016 16:26:08 +0530 Subject: [PATCH 1/4] Move default test case to base class. Issue #13: Defining a new variable in each derived class to store the same default test case seems redundant. Therefore, I have shifted this test case into a static final variable in the base class. --- .../classes/random/text/generator/Gui$1.class | Bin 0 -> 515 bytes build/classes/random/text/generator/Gui.class | Bin 0 -> 2089 bytes .../text/generator/RandomTextGenerator.class | Bin 2421 -> 3410 bytes .../generator/SpaceEfficientGenerator.class | Bin 2566 -> 2535 bytes .../generator/SpeedEfficientGenerator.class | Bin 4096 -> 4065 bytes nbproject/private/private.properties | 2 +- .../text/generator/RandomTextGenerator.java | 16 +++++++++++++++- .../generator/SpaceEfficientGenerator.java | 15 --------------- .../generator/SpeedEfficientGenerator.java | 15 --------------- 9 files changed, 16 insertions(+), 32 deletions(-) create mode 100644 build/classes/random/text/generator/Gui$1.class create mode 100644 build/classes/random/text/generator/Gui.class 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 0000000000000000000000000000000000000000..2cb0a3ed2820e055fe1602e80f9ec47ed679dde0 GIT binary patch literal 515 zcmZ`$O;5r=5Pe$;Eww75qDZ`P01sA-#skI+QDagy5rZ+F7TCa&vQ4(F@o#w|(ZnC% zk1|eyh!+mKZ)V=kn~(ke`S=2Gf{KGIwk&KrFj6d8*s-w7kUN)3#up5kTD`+yw!*$( zSoft8cgeUb^ds*E6e;>)j|UyDW$Mp^W;~P;gL|Wt(5-++ksx>9*If0(u@{TC*c%Aq zcpPf)I+4{zlPc*%F*xlo(LHe`Q+1oT!x4YwRQgi&f-sV5a4X_r*mqIJo(l^$LwTt% zLuDyfZ7>v4aWCL%;N5peq8HOdi_k-&)ND+1%q2Bfs=fFNx*cn3r&;gd2qx{3wnj@e z=ulVW<;n608DaKd0`@+o9lCSV;4xOnc4rR=*T|zu|B}y0EKSaT!g!t_^Ry61|114K e8>jz7@^g_43d9=NK#|ZSYZI$vIV5Ki0`@PX?PntZ literal 0 HcmV?d00001 diff --git a/build/classes/random/text/generator/Gui.class b/build/classes/random/text/generator/Gui.class new file mode 100644 index 0000000000000000000000000000000000000000..60e263c73494dc3f87e8a78cb7c1dfee1548b20b GIT binary patch literal 2089 zcmZ`)TUQfT6#fPhCJduOR4}L*>ZK8asl8XM7J^V{L<tP9_NUqVGPn zZ+&PV`qIAkC2^It`UCoV`rOrT&wvCk$y(>kzVGwxefIh1zrX$l@GhPhIFG!645oBk zOJLeSCuU^%RL86V9eEvd2Daz-UlWudBL-uFJM-2Uj$7X3j5Zh~>Si(r~C?yK25sD=WWfl^t@D1+QW`OO|g7y~B(J z4{Z84Uhplq>eX_A+6;0livF#@^K&x|dz>yMfQI<8Z`J7NNMY65ur_n`hqk+to0}Fc zwc_iRtDKj_H-#%=$11-8* zBg+aAMvI(oy?3Tj|{bRnq|>xM1QT2;kxN^UduR?!XQ}D%3Tx zDcEk|k%@2d9h>sCJ$dG$j_*zUfX5nAuhr7fD`BI$-zcxD3Sl{#d37@!tE*s2En5vI z$U9zL-B_0^K$O`>nOSL^~ogS_VkY%b-GhoWv8McZ_`JrUQK}uiNzbn;f7+_>er{>#tMFz7>RN3**os6Nh8cum z_Fao|XqJmqW^m3U9C-p+%WX zw*uR-16u}UkL_-FYpOt){5{9vG+1c3u1rJ1jA1?j=Q**#!K=wV=Q>7eoV&)od!z+z zq=}9{Np#=>*Mn3AdJ#h(5*+k7Qf8!#w{Ve^CbNPo9ce|x(M8@L+vqGMV=crBqg_pO zZ9^}$khq@RMt3PozR^Sv3A5DKai>rFw}k^u9L)9_(f=6^HPJhoZKCh?Hj<^};TDd} zk0tw?7|4z_ag5wlDUoPl@KP)lOCE3H1UHILW>c|9K2%DcY9W0oo{EcLIGc)#V6=%h zMztnRk5cc<-Z__WlzI2_F&n@kK3fAA#2FmNdpLn9oWvYXp@=l@62$vBjWtSrzFS*3 zhbM&fDS`b7BlwwE{6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S9jrFA4P;9c*2_JZW49g1^;;W#7Y4Mrsehf@TS(~>cl zHRNp0m|AR)vzn4=%LWyjapRnIIY-szyr~x?7i}(?-((Fg&qaSkBu6Zxk4X=9k_Jh(Mg+D-oLB#uvaUW ZW_sC%(C$91E%vi(*%x~6C+TW({sPvAYH9!g delta 536 zcmXAm%TE(g6ougZe`JS0o1|Q_*{?S4_vt zR58g$^B`zzja5egsY}s+mi0j-Cr2O`deATb|6~#?%Np36d za91*|xW|3P17;+VVC6_K9^`7_a5>i#jApwl;n<{PR`HNWQHR~tHpgSd6J`{1JXJj7 zxj^;@y-rf*>v^`rfPkSsHz9ph1JFn#%-o`&tOP28CS@qkh z7fI*`tJB%-U-1j+>}S^Xe4@E+Me8E#7g@WYU5lJ%nxtlz?%zTqTWMt*d0ol;-#{-r iwMwvxUHX%S?rEftje6Q*w{|T0^(463YobhdL+T&C{AVBl 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..d114201 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 { - + 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; 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(); From 164bc429fe1cae47772677294ce8c4d5c7c0df3b Mon Sep 17 00:00:00 2001 From: Yash Ugrankar Date: Sun, 30 Oct 2016 00:17:26 +0530 Subject: [PATCH 2/4] Added getDefaultText() --- .../text/generator/RandomTextGenerator.class | Bin 3410 -> 3486 bytes .../text/generator/RandomTextGenerator.java | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/classes/random/text/generator/RandomTextGenerator.class b/build/classes/random/text/generator/RandomTextGenerator.class index e17e52e15366ed986d5ff0d3c8ade6bdb8be87a8..f0a56d4d9103784b96cbf027ad78ede8772cbab7 100644 GIT binary patch delta 1030 zcmY+C+iz4=6vltMbLQ-s!!B*7wBw;I(prU1XDBdOWDsfanE3MTb^Xp->pQ!F+TIh@8@@kAd9!uD3oqd}9G5R$F9x?hfuX%X%Ss2v3?or7bHgmv};x|3s z;-H1ME#x(aZ0>N3AzN6maKyr}4Zq_t(#)te-;FcIdojj6-e{?{RxP8%Usc1HGIW2MQ3owS+^pS(M%b>CT$38*LAZ0`@rr)qlLr8nJ|`8!Qb&m9WA0< zghrmC6~)uyRiLS{`-xp+_x>-Q!UO#agn08L7&Yec?&y`(=Vvg02J+(hfmW zwj-=&jd)6am1hN|RZSBWrQrJp_dBBM{v5HvS>ikA@Z?>zE0g+x=)5}=Vmh5UDhI_c zMeCed7U!aAKN?as&~RQYOw*sTUUkm(-CyYO-H@7FxOdr{v38uiU30e9h4IzyWXi6*#c`{uJSsv1CS9P$f_L2}> zDR)azB|0TZ%iHkkA>yV5$lqYD#}%=lBG-C%Ad~4{`dOv z1n@C80;*_<-6(W8c=OFz)-vu1vd+Qvq&;Otq9KO|%@AIR=&Ga76 zD2l_Tc=7Oyo1-~3Tjkrrq$a6Eb2xmK_oDEKp_;`CXYY|Eh73o;=T3e2uU_gL&$iHSUBn`oCYT zoRaFr!?}{s4_?(($!9psWFGTTBt^?(0fj7Nk;sL%y?6E+oUmcqzN}>`>S++H1vNqp zU)Z^F?=CU*U>w~!hQEEBxZFWYZOtQM6JAfmv_^Lv(`ofmcZ~dWER~2we9%!oq$Wpb zud!M|+Dmx<(46ohrr*T7$C_Fz7f!_|ylkl(QS^l3v`!^-L`hMpK!;6i!)I71OXx9X zrepUe@28xU6Os6vSrO$AnO!s|q9PSBH=^=^RPC}yUH%0Rv5xZ<~^~zX6QypQHc) diff --git a/src/random/text/generator/RandomTextGenerator.java b/src/random/text/generator/RandomTextGenerator.java index d114201..9efcfee 100644 --- a/src/random/text/generator/RandomTextGenerator.java +++ b/src/random/text/generator/RandomTextGenerator.java @@ -10,7 +10,7 @@ * to form a new text. This technique is called the Markov chain. */ public abstract class RandomTextGenerator { - static final String defaultText = "She is into superstitions, black cats and voodoo dolls. " + 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. " @@ -32,6 +32,10 @@ public RandomTextGenerator(String text) { this.text = text.split("\\s+"); } + public String getDefaultText(){ + return defaultText; + } + public String generateText(int wordAmount) { if (wordAmount <= SETSIZE) return null; From ae1039687a620820525ccebf125d353b397d0d67 Mon Sep 17 00:00:00 2001 From: Yash Ugrankar Date: Sun, 30 Oct 2016 11:58:43 +0530 Subject: [PATCH 3/4] Made getDefaultText() static --- .../text/generator/RandomTextGenerator.class | Bin 3486 -> 3468 bytes .../text/generator/RandomTextGenerator.java | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/build/classes/random/text/generator/RandomTextGenerator.class b/build/classes/random/text/generator/RandomTextGenerator.class index f0a56d4d9103784b96cbf027ad78ede8772cbab7..0fd006a1d7934d1a62302790a3f165a7a4ff2ff6 100644 GIT binary patch delta 53 zcmbOy-6OqW8n*@~gAs!<10#bj0|SFJkOl!}A@&VGijhGNNV0(iRW@JXKF0_E$x{av delta 71 zcmeB?o+rIw8n+cAgAs!<10#bj0|O8<0wDtfvk?0RAjQO>2PE0RLMjaUKsFCVn!$j< Mkbz Date: Sun, 30 Oct 2016 18:55:09 +0530 Subject: [PATCH 4/4] Integrate GUI with the application. Issue #15: I have added a JComboBox to select the type of generator which should process the input text, along with a separate text area to display the result. I have also added an event listener to the 'Generate Text' button. When the button is clicked, the application will create an object of the selected generator type with the text in the input area as a parameter to its constructor, and call the generateText() method. I have selected a word limit of 200 here, but I suppose a text field to enter the word limit could be added to the GUI at a later stage. Finally, I have added a JLabel at the bottom to display the time taken for execution (in milliseconds). The label contents are updated each time the 'Generate Text' button is clicked. --- .../classes/random/text/generator/Gui$1.class | Bin 515 -> 515 bytes build/classes/random/text/generator/Gui.class | Bin 2089 -> 2266 bytes nbproject/private/private.xml | 6 +++++- src/random/text/generator/Gui.java | 13 +++++++++---- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build/classes/random/text/generator/Gui$1.class b/build/classes/random/text/generator/Gui$1.class index 2cb0a3ed2820e055fe1602e80f9ec47ed679dde0..86169fc06065535740d254704d3cef08e8a6c9e4 100644 GIT binary patch delta 23 ecmZo>X=d5b&d6v!xr5Px)slgO!D{kZMl%3QVFmI4 delta 23 ecmZo>X=d5b&d6vqxr5Px)r5hA!F2LjMl%3P&;{cF diff --git a/build/classes/random/text/generator/Gui.class b/build/classes/random/text/generator/Gui.class index 60e263c73494dc3f87e8a78cb7c1dfee1548b20b..b52581d308cb2fb59b103d4babf606b3c1789ef4 100644 GIT binary patch delta 891 zcmYjQO-~b16g_XI(>Dx5g~kAbVDSTNX|dq9paKd4il~5M{Xj=3rBGTdQ$R!!MBSJe zGp^VemL|qTF)c!Z3peT?FmdC;|6#n3lHgmMx#!*c?mPG1H*fQQ70mwlySfhG5T0wO zLW>3;&T_P>Xwx90UBEex^BOo>I65@s;DR8X92Yg{xFpDB4PEFKR*yJvh2yGJwTsE%Qb*pnM1 zrehRw`@K|D5-VFI@Tw=*!pwbBU6RW2$qi;@C z2COO#=>ri7K|&XW0{L*D04hzRhM1lWMlB8yW1>BTl!(2ALc;>S+cVD5p%v^%qttM? z3)3hI7>+cGd)HuuR5gQ=I>k`jJB44_^eb7vC*&^AU{{^fa0 z%2Tl=aFCi*!)s^9QGsci^BlZ*LGRI~N*CeB5{Y|9;+CnLRg%0;qQ8>lZ}fUaF>P7F zo5g7OLi>lQoFaV05ges9^w2Di;W#y71bwKZZaL_NlQ=<^Lb=PxKGhE=J@N)LW;;RQ u5?Mg*8Y)8>>|23%OS48!P;QNKY&A3&O*l>a63%R3GpQH90HdnJQvU(7N0y%e delta 757 zcmZva$xjqP6vlr&%}_l>#|)#WBN1Ex(HU*Q6;O~x5JcQY5L`zYaaeU2S=`{@jl=}| z|#}w@vMYEzq6XLi5or)70mo5WNYEE(5?9P~ivx_HimRG(qc6!d#dSsh{L+`Q zP&PG{ZB3_!`z_XW4kjm(Q{MPwdUU|+NJykHlSWn&3@ zTNF7d4rFNDdX5Jzs*6XZ$;@+`ZllD}oTG&QnK5F}rGFa4kSBUZ#usx{Rm zy^+#IHq{2B!N}Sio8!@7j`cmU99v>mj;*o09A$5$D1agCrpW)Os%A2B`O{P|EAufY z0-vyhr$V$KM9(Gjg-9`C>X!-siP1b`kIa@l4)g3|znq$o?*Ip-ks%IKL#;G3$42Tn zByvOIt6!Ecv4HHL-~;XDy^B=5W7~={Em5RdEvKzqLjesO5r2TjzqUzqn&GoVzgf;7 Dm - file:/C:/Users/Ma%20Jing/Documents/NetBeansProjects/Random%20Text%20Generator/src/random/text/generator/SpaceEfficientGenerator.java + file:/D:/OSS/Hacktoberfest/Random-Text-Generator/src/random/text/generator/SpaceEfficientGenerator.java + file:/D:/OSS/Hacktoberfest/Random-Text-Generator/src/random/text/generator/SpeedEfficientGenerator.java + file:/D:/OSS/Hacktoberfest/Random-Text-Generator/src/random/text/generator/RandomTextGenerator.java + file:/D:/OSS/Hacktoberfest/Random-Text-Generator/src/random/text/generator/WordSet.java + file:/D:/OSS/Hacktoberfest/Random-Text-Generator/src/random/text/generator/Gui.java diff --git a/src/random/text/generator/Gui.java b/src/random/text/generator/Gui.java index 719b426..772015c 100644 --- a/src/random/text/generator/Gui.java +++ b/src/random/text/generator/Gui.java @@ -32,10 +32,15 @@ public void init() { label.setAlignmentX(Component.CENTER_ALIGNMENT); panel.add(label); - JTextArea textField = new JTextArea(5, 5); - textField.setText("Not randomly generated text."); - textField.setAlignmentX(Component.CENTER_ALIGNMENT); - panel.add(textField); + JTextArea inputTextArea = new JTextArea(5, 5); + inputTextArea.setText(RandomTextGenerator.getDefaultText()); + inputTextArea.setAlignmentX(Component.CENTER_ALIGNMENT); + panel.add(inputTextArea); + + JTextArea outputTextArea = new JTextArea(5, 5); + outputTextArea.setText("Not randomly generated text."); + outputTextArea.setAlignmentX(Component.CENTER_ALIGNMENT); + panel.add(outputTextArea); JButton generateTextButton = new JButton("Generate text"); generateTextButton.setAlignmentX(Component.CENTER_ALIGNMENT);