From 0e1d4f72703430ca38bf1539e591bf788c512840 Mon Sep 17 00:00:00 2001 From: Yelz <1029396437@qq.com> Date: Sun, 7 Oct 2018 15:54:04 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20063/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 063/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 063/.keep diff --git a/063/.keep b/063/.keep new file mode 100644 index 0000000..e69de29 -- Gitee From 91dd3e2a8cdefe4cf869da42241ae9c1c45a81d9 Mon Sep 17 00:00:00 2001 From: Yelz <1029396437@qq.com> Date: Sun, 7 Oct 2018 19:56:59 +0800 Subject: [PATCH 2/5] Upload .keep .gitignore result.txt .project 2.txt 1.txt .settings/org.eclipse.core.resources.prefs .classpath .settings/org.eclipse.jdt.core.prefs bin/wCount/CountWordFrame.class bin/junitTest/WordTest.class bin/wCount/FileAdapter.class bin/wCount/Main.class bin/wCount/Word$1.class bin/wCount/MainFrame.class bin/wCount/Word.class src/junitTest/WordTest.java src/wCount/CountWordFrame.java src/wCount/FileAdapter.java src/wCount/Main.java --- 063/.classpath | 7 ++ 063/.gitignore | 1 + 063/.project | 17 +++ .../org.eclipse.core.resources.prefs | 2 + 063/.settings/org.eclipse.jdt.core.prefs | 11 ++ 063/1.txt | 2 + 063/2.txt | 13 +++ 063/bin/junitTest/WordTest.class | Bin 0 -> 898 bytes 063/bin/wCount/CountWordFrame.class | Bin 0 -> 4117 bytes 063/bin/wCount/FileAdapter.class | Bin 0 -> 1734 bytes 063/bin/wCount/Main.class | Bin 0 -> 406 bytes 063/bin/wCount/MainFrame.class | Bin 0 -> 4891 bytes 063/bin/wCount/Word$1.class | Bin 0 -> 1459 bytes 063/bin/wCount/Word.class | Bin 0 -> 2962 bytes 063/result.txt | 5 + 063/src/junitTest/WordTest.java | 48 +++++++++ 063/src/wCount/CountWordFrame.java | 101 ++++++++++++++++++ 063/src/wCount/FileAdapter.java | 34 ++++++ 063/src/wCount/Main.java | 9 ++ 19 files changed, 250 insertions(+) create mode 100644 063/.classpath create mode 100644 063/.gitignore create mode 100644 063/.project create mode 100644 063/.settings/org.eclipse.core.resources.prefs create mode 100644 063/.settings/org.eclipse.jdt.core.prefs create mode 100644 063/1.txt create mode 100644 063/2.txt create mode 100644 063/bin/junitTest/WordTest.class create mode 100644 063/bin/wCount/CountWordFrame.class create mode 100644 063/bin/wCount/FileAdapter.class create mode 100644 063/bin/wCount/Main.class create mode 100644 063/bin/wCount/MainFrame.class create mode 100644 063/bin/wCount/Word$1.class create mode 100644 063/bin/wCount/Word.class create mode 100644 063/result.txt create mode 100644 063/src/junitTest/WordTest.java create mode 100644 063/src/wCount/CountWordFrame.java create mode 100644 063/src/wCount/FileAdapter.java create mode 100644 063/src/wCount/Main.java diff --git a/063/.classpath b/063/.classpath new file mode 100644 index 0000000..97f7210 --- /dev/null +++ b/063/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/063/.gitignore b/063/.gitignore new file mode 100644 index 0000000..ae3c172 --- /dev/null +++ b/063/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/063/.project b/063/.project new file mode 100644 index 0000000..e38873f --- /dev/null +++ b/063/.project @@ -0,0 +1,17 @@ + + + 201621123063 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/063/.settings/org.eclipse.core.resources.prefs b/063/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..4824b80 --- /dev/null +++ b/063/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/063/.settings/org.eclipse.jdt.core.prefs b/063/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..3a21537 --- /dev/null +++ b/063/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/063/1.txt b/063/1.txt new file mode 100644 index 0000000..36664e6 --- /dev/null +++ b/063/1.txt @@ -0,0 +1,2 @@ +I love dasd +dasd \ No newline at end of file diff --git a/063/2.txt b/063/2.txt new file mode 100644 index 0000000..3e71c37 --- /dev/null +++ b/063/2.txt @@ -0,0 +1,13 @@ +A man may usually be known by the books he reads as well as by the company he keeps; for there is a companionship of books as well as of men; and one should always live in the best company, whether it be of books or of men. + + A good book may be among the best of friends. It is the same today that it always was, and it will never change. It is the most patient and cheerful of companions. It does not turn its back upon us in times of adversity or distress. It always receives us with the same kindness; amusing and instructing us in youth, and comforting and consoling us in age. + + Men often discover their affinity to each other by the mutual love they have for a book just as two persons sometimes discover a friend by the admiration which both entertain for a third. There is an old proverb, Love me, love my dog. But there is more wisdom in this: Love me, love my book. The book is a truer and higher bond of union. Men can think, feel, and sympathize with each other through their favorite author. They live in him together, and he in them. + + A good book is often the best urn of a life enshrining the best that life could think out; for the world of a mans life is, for the most part, but the world of his thoughts. Thus the best books are treasuries of good words, the golden thoughts, which, remembered and cherished, become our constant companions and comforters. + + Books possess an essence of immortality. They are by far the most lasting products of human effort. Temples and statues decay, but books survive. Time is of no account with great thoughts, which are as fresh today as when they first passed through their authors minds, ages ago. What was then said and thought still speaks to us as vividly as ever from the printed page. The only effect of time have been to sift out the bad products; for nothing in literature can long survive e but what is really good. + + Books introduce us into the best society; they bring us into the presence of the greatest minds that have ever lived. We hear what they said and did; we see the as if they were really alive; we sympathize with them, enjoy with them, grieve with them; their experience becomes ours, and we feel as if we were in a measure actors with them in the scenes which they describe. + + The great and good do not die, even in this world. Embalmed in books, their spirits walk abroad. The book is a living voice. It is an intellect to which on still listens. \ No newline at end of file diff --git a/063/bin/junitTest/WordTest.class b/063/bin/junitTest/WordTest.class new file mode 100644 index 0000000000000000000000000000000000000000..9aa114e3a3e4ec26d5eb535e67fbfc63e0ad95db GIT binary patch literal 898 zcmbV}O;Zy=5Qg8$*Wwx=A)q3k@t|ld_QDOzDx}aVDy3Bd;XFwOGO4fwv$K|ei<6cI ze}F&A@||@_D9tH{-R_?0e!BaeU%!9+1h9u@fP%o%Fpaf4Rf&tvjqQ6UKuMrBlwV{t zlJRBqsXJ6XCs28#nfg|sxbw0jP&zby6{3g-Rg_T?SZwQ9eN3;q%AU&ZND@r}Uh=QMWuN_BLi+2J6L zjgwhX*4$o3S(E6Ux-eD|zu>sw2jvb2(sESp**4=Wzx;lP$5;*UgjbWBgCtSbRq+&S z0#%tsM>nY)agp-Q@v+zA4((;k(Dl66iLp-g{V{9vGcOfu!xNL*o_epnTJv`guLrqVWNptVSQJ(ada9SYd~1F>+8;{X5v literal 0 HcmV?d00001 diff --git a/063/bin/wCount/CountWordFrame.class b/063/bin/wCount/CountWordFrame.class new file mode 100644 index 0000000000000000000000000000000000000000..30a57f8865ebc7962331e8a304eb2842a5e109e0 GIT binary patch literal 4117 zcmd5r1j_Vz9p(m0MY z&N!FsJ^MZ%@AL6{p7*_%|M}eW0B*zC_bQ-e z6|*o~z?0FfcEd7t3hN!L*LJXQwTd~ID6A6lG0qE{r1aIySXP#SOSopq!N2VrgAZxqn!OpuDeVioUV6`57YGX*!JRz{6e3EQKBhKdkwp^!$ zRc*e&JSV>#c5ZEhme6|jbX{$S463u&!4*SFK@=<5+-#=ar{eusC7_UhjeS~rRn()yPOfhEOQ z+tl5!$E-RB6-8=P;>}p;!8XcGjKbDpmY&W;dG&)Tc3>ydJv<{>$}t8hCxbQCh7s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)r8n^cwYeLMq&M&#yhu}YiFAc7SZqQXTi4~c5tb4b}I8sU;zfRt{@GJb9zWKBo!W;N) HY1zL3v&Js} literal 0 HcmV?d00001 diff --git a/063/bin/wCount/FileAdapter.class b/063/bin/wCount/FileAdapter.class new file mode 100644 index 0000000000000000000000000000000000000000..3148e40a06c80d3218f2b06b8deb3dce2f06eb40 GIT binary patch literal 1734 zcmZ`(-%}e^6#j15uwlDEA(UUW)c#NsNT5=RwyD)ZOGQJdg25E4U6Ktf4ZE4mM(Cpt zj!&I&#u;b&rsH(_#&qhte}~1s`Q&T$yPH5msSkVi-gD2n=li~M?)~HGZ;t>> zqNpMu(7iR|lx=T()+(5nb4JlKT@{MJ;SJ+6W4vJ4YvT*68)nuMXuW9JmUl^@B@#^w zC^JsZ)X;)99YM4TbS5p^OqDlRO?SyyEtot!>12&U+HftoZWtAB-6{$6BoAgz2?nG^d0w38;;?)ilKetEZ!-3=BAF9ae~oK znK~WWgM6JNJi;`M%|r;N1dcxWsruy6*N?xrzw^WQe|`7k&NpBFS*tw$>h9kUKiBXI zhE=@Uguf|XM+8v;wJ47)*v!&Urdf(;TE(cqv1W!T$D3t^b4^N&piRY?Kwq=poLww8 zuxg0oj4bMF0$tA+fGN%j^!lMqxu?tdyylx+cKCfI3+gf1ZH(y z!#e^YZ?C_4A}{PHCC}av=-8{I>=kxeOJ26_z&>-6aMEM7oEHeJOmir$3iSUUc7gUq z&&b}MH;VqnP?2K0ExVS-_Lu2G_>isbnx%5V8}qh3*_O*vz^I&Mbli{)+MXqE&rF$H zGDgM6yS3qssjFn>{6l%IKjDpRE_vOq;U>;#Sb-rAC*<(6lGi;FvQ{g|=`dvv2Dc31&nK@c~gcHOCgovgMy|fH*JxqjgTBeBb zJP}?ax_Qpi2($1#KAXupPI^l=M2tDSOCH0Fcn?W3i{mV#Qp_`j5iH<3xxG)%E+`$H zPcf(>uHpj~6JdreB6>iKyG)@lAYMaHrhBQ1^gIcCv|PhVriPoDSQVdEaVr(4N?B6O z^Ru35KjbUgPfi2GK8WLdRZsI7jgVuEZ>FrtNIk(Gi#RrLn{YIoLVP@RosF0#*(vEjR@B7wvQ@KK04 zKynJ2+1tm=?B3_s+XsMi96RU;^k0@`qwC;WD(%1$@Hg^V2D#K(a2s#Zq!zF*l~(nY zKzBBe1gvHGkb3CC9iRtWU=%8y-ZVv=R(CSaQ-N_$0hmbfwHfuDS2b=;H)D zgg*du_~HRXhgrZV7<;E%?7jZ9J)&uYgg$ZbJHR+(=3*ZsRt))q(absT@V6MZbdN4Z T#O7El;b4M8)&-7;9ZbIganehJ literal 0 HcmV?d00001 diff --git a/063/bin/wCount/MainFrame.class b/063/bin/wCount/MainFrame.class new file mode 100644 index 0000000000000000000000000000000000000000..68c381c3437b4e51dd90e1bf5113ca265292dcf7 GIT binary patch literal 4891 zcma)A33yc175;BB$r~mwEW<7m5Tho;5)`%7APRv%XhNuo34us`nR!VbOlHQJHzc67 zh#;bZD^{beVijs@L6l4)q1Y8$+uGVqYwd0Vbfc}ctJePazBiMBXup2>=H2a_d(J)g zKg-Qa|2cdVz{TPM4LJg%J1e5eh+S4=Sdq%O(P3)v2>90-8;q{9M5h&LD_ic)=L<}g z^JPY-U1n}D$+a+OThU0hm9Wi-85i&c+oREhS!sn$f$`O+?XoCo+tEn5fY*-3lu&lV zX2k7koUJ#zY=Lo#Pf3vzm6jO}kxe75L!hl&X++HMg=x}^qH0=_Is_MGdh;l%l}fGP z0f%u_8!cv-T=`N1E5?qLBs+@7k?D7o3L7*?ogJrL$l;ND3XF8ttZ11$xZG*J6|w9E z0=Xrn4J50GhD;xFQKaK6Oz~nmEqvm@&XbSdbG-l26Z`kHY-}>an|u(Mq2pW>Q*y$z z>n&TEv1GXD(gsOkK zdF%onyE+;)Bm^~72#n2~c4^!SRT~?lNirGE{Lx$*R@`rnvT%sCMRR zjEK=@#>-0^G?|Q5_n*a;{EC zJ+7h2jZo-JcbSnT`u!Y=8hFttFnRFK9S&XwcilU1_^yE+J0k--cXLY0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#ng9R* literal 0 HcmV?d00001 diff --git a/063/result.txt b/063/result.txt new file mode 100644 index 0000000..bff850d --- /dev/null +++ b/063/result.txt @@ -0,0 +1,5 @@ +characters:17 +words:2 +lines:2 +[dasd]:2 +[love]:1 diff --git a/063/src/junitTest/WordTest.java b/063/src/junitTest/WordTest.java new file mode 100644 index 0000000..886ded4 --- /dev/null +++ b/063/src/junitTest/WordTest.java @@ -0,0 +1,48 @@ +package junitTest; + +import static org.junit.Assert.*; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.junit.Before; +import org.junit.Test; + +import wCount.FileAdapter; +import wCount.Word; + +public class WordTest { + + @Before + public void setUp() throws Exception { + + } + + @Test + public void testGetCharNum() + { + + assertEquals(1,1 ); + } + + @Test + public void testGetWordNum() + { + assertEquals(1, 1); + } + @Test + public void testGetSortedWord() + { + assertEquals(1, 1); + } + @Test + public void testGetLines() + { + assertEquals(1, 1); + } + + + +} diff --git a/063/src/wCount/CountWordFrame.java b/063/src/wCount/CountWordFrame.java new file mode 100644 index 0000000..e6fc8f2 --- /dev/null +++ b/063/src/wCount/CountWordFrame.java @@ -0,0 +1,101 @@ +package wCount; + +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridLayout; +import java.awt.Toolkit; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; + +public class CountWordFrame extends JFrame{ + + private JLabel label1; + private JPanel jPanel; + + public CountWordFrame(String fileText,int flag,int para) { + + this.setTitle("词频统计byYelz"); + this.setSize(800, 600); + + Toolkit kit = Toolkit.getDefaultToolkit(); + Dimension dimension = kit.getScreenSize(); + Dimension size = this.getSize(); + int x = (int) (dimension.getWidth() - size.getWidth()) / 2; + int y = (int) (dimension.getHeight() - size.getHeight()) / 2; + this.setLocation(x, y); + + this.setLayout(new GridLayout(3, 1)); + + Word wd = new Word(fileText); + + int charNum = wd.getCharNum();//字符数量 + int lines = wd.getLines();//有效行 + List> sortedWord; + int wordNum; + String s = ""; + String strForFile = ""; + if(flag ==0) + { + sortedWord=wd.getSortedWord();//得到排序后的存放单词和词频键值对的list + wordNum = sortedWord.size(); + s += "characters:"+ charNum + "
words:" + wordNum + "
lines:" + lines + "
"; + strForFile += "characters:"+ charNum + "\r\nwords:" + wordNum + "\r\nlines:" + lines + "\r\n"; + int cnt = para; + if(sortedWord.size()>cnt) + { + for (int i = 0; i < cnt; i++)//输出词频最高前十单词 + { + s += "["+sortedWord.get(i).getKey()+"]:"+sortedWord.get(i).getValue() + "
"; + strForFile += "["+sortedWord.get(i).getKey()+"]:"+sortedWord.get(i).getValue() + "\r\n"; + } + } + else + { + for (int i = 0; i < sortedWord.size(); i++)//输出词频最高的单词 + { + s += "["+sortedWord.get(i).getKey()+"]:"+sortedWord.get(i).getValue() + "
"; + strForFile += "["+sortedWord.get(i).getKey()+"]:"+sortedWord.get(i).getValue() + "\r\n"; + } + } + } + else + { + sortedWord=wd.getLengthSortedWord(para);//得到排序后的存放单词和词频键值对的list + wordNum = sortedWord.size(); + s = "characters:"+ charNum + "
words:" + wordNum + "
lines:" + lines + "
"; + strForFile += "characters:"+ charNum + "\r\nwords:" + wordNum + "\r\nlines:" + lines + "\r\n"; + for (int i = 0; i < sortedWord.size(); i++)//输出词频最高的单词 + { + s += "["+sortedWord.get(i).getKey()+"]:"+sortedWord.get(i).getValue() + "
"; + strForFile += "["+sortedWord.get(i).getKey()+"]:"+sortedWord.get(i).getValue() + "\r\n"; + } + } + + //结果写入result.txt文件 + try { + FileAdapter fileAdapter = new FileAdapter(); + fileAdapter.WriteToFile(strForFile); + } catch (IOException e) { + e.printStackTrace(); + } + + jPanel = new JPanel(); + label1 = new JLabel(""+s+""); + label1.setFont(new Font("宋体", 1, 25)); + jPanel.add(label1); + this.add(jPanel); + + this.setLayout(new GridLayout(1, 1)); + this.setVisible(true); + + + } + + + +} diff --git a/063/src/wCount/FileAdapter.java b/063/src/wCount/FileAdapter.java new file mode 100644 index 0000000..8265ecc --- /dev/null +++ b/063/src/wCount/FileAdapter.java @@ -0,0 +1,34 @@ +package wCount; + +import java.io.*; + +public class FileAdapter { // 该类用于文件写入读取的处理 + + public String FileToString(File file) throws IOException { // 将文件转化为字符串 + if (!file.exists() || file.isDirectory()) { + System.out.println("请输入正确文件名!"); + throw new FileNotFoundException(); + } + FileInputStream fis = new FileInputStream(file); + byte[] buf = new byte[1024]; + StringBuffer sb = new StringBuffer(); + while ((fis.read(buf)) != -1) { + sb.append(new String(buf)); + buf = new byte[1024];// 重新生成,避免和上次读取的数据重复 + } + fis.close(); + return sb.toString(); + } + + public void WriteToFile(String str) throws IOException { // 将传入的字符串写入文件 + File writename = new File("result.txt"); // 相对路径,如果没有则要建立一个新的文件 + writename.createNewFile(); // 创建新文件 + BufferedWriter out = new BufferedWriter(new FileWriter(writename)); + out.write(str); + + out.flush(); // 把缓存区内容压入文件 + out.close(); // 关闭文件 + + } + +} diff --git a/063/src/wCount/Main.java b/063/src/wCount/Main.java new file mode 100644 index 0000000..201a0a4 --- /dev/null +++ b/063/src/wCount/Main.java @@ -0,0 +1,9 @@ +package wCount; + +public class Main { + + public static void main(String[] args){ + new MainFrame(); + } + +} -- Gitee From d569fdc2aa909436cce79f164a5b508e932d33f4 Mon Sep 17 00:00:00 2001 From: Yelz <1029396437@qq.com> Date: Sun, 7 Oct 2018 19:58:28 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9B=AE=E5=BD=95063/bin?= =?UTF-8?q?/junitTest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 063/bin/junitTest/WordTest.class | Bin 898 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 063/bin/junitTest/WordTest.class diff --git a/063/bin/junitTest/WordTest.class b/063/bin/junitTest/WordTest.class deleted file mode 100644 index 9aa114e3a3e4ec26d5eb535e67fbfc63e0ad95db..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 898 zcmbV}O;Zy=5Qg8$*Wwx=A)q3k@t|ld_QDOzDx}aVDy3Bd;XFwOGO4fwv$K|ei<6cI ze}F&A@||@_D9tH{-R_?0e!BaeU%!9+1h9u@fP%o%Fpaf4Rf&tvjqQ6UKuMrBlwV{t zlJRBqsXJ6XCs28#nfg|sxbw0jP&zby6{3g-Rg_T?SZwQ9eN3;q%AU&ZND@r}Uh=QMWuN_BLi+2J6L zjgwhX*4$o3S(E6Ux-eD|zu>sw2jvb2(sESp**4=Wzx;lP$5;*UgjbWBgCtSbRq+&S z0#%tsM>nY)agp-Q@v+zA4((;k(Dl66iLp-g{V{9vGcOfu!xNL*o_epnTJv`guLrqVWNptVSQJ(ada9SYd~1F>+8;{X5v -- Gitee From 114d117f0c42cbe2160ef8a1ed435fe3d9dc4a15 Mon Sep 17 00:00:00 2001 From: Yelz <1029396437@qq.com> Date: Sun, 7 Oct 2018 21:18:03 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9B=AE=E5=BD=95063/src?= =?UTF-8?q?/junitTest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 063/src/junitTest/WordTest.java | 48 --------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 063/src/junitTest/WordTest.java diff --git a/063/src/junitTest/WordTest.java b/063/src/junitTest/WordTest.java deleted file mode 100644 index 886ded4..0000000 --- a/063/src/junitTest/WordTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package junitTest; - -import static org.junit.Assert.*; - -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; - -import wCount.FileAdapter; -import wCount.Word; - -public class WordTest { - - @Before - public void setUp() throws Exception { - - } - - @Test - public void testGetCharNum() - { - - assertEquals(1,1 ); - } - - @Test - public void testGetWordNum() - { - assertEquals(1, 1); - } - @Test - public void testGetSortedWord() - { - assertEquals(1, 1); - } - @Test - public void testGetLines() - { - assertEquals(1, 1); - } - - - -} -- Gitee From 7ec700c6afc0470bf355ddf795660f64b900cf65 Mon Sep 17 00:00:00 2001 From: Yelz <1029396437@qq.com> Date: Sun, 7 Oct 2018 21:18:19 +0800 Subject: [PATCH 5/5] Upload Word.java MainFrame.java --- 063/src/wCount/MainFrame.java | 160 ++++++++++++++++++++++++++++++++++ 063/src/wCount/Word.java | 96 ++++++++++++++++++++ 2 files changed, 256 insertions(+) create mode 100644 063/src/wCount/MainFrame.java create mode 100644 063/src/wCount/Word.java diff --git a/063/src/wCount/MainFrame.java b/063/src/wCount/MainFrame.java new file mode 100644 index 0000000..d2be979 --- /dev/null +++ b/063/src/wCount/MainFrame.java @@ -0,0 +1,160 @@ +package wCount; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.GridLayout; +import java.awt.Label; +import java.awt.TextField; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.io.IOException; +import java.util.regex.Pattern; + +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; + +public class MainFrame extends JFrame implements ActionListener{ + + private JButton chooseFile,topCount,lenCount; + private TextField topText,lenText; + private JPanel jPanel1,jPanel2,jPanel3; + private JLabel fileName,topTip,lenTip; + private String fileText; + private File file; + public MainFrame() { + this.setTitle("词频统计byYelz"); + this.setSize(800, 600); + + Toolkit kit = Toolkit.getDefaultToolkit(); + Dimension dimension = kit.getScreenSize(); + Dimension size = this.getSize(); + int x = (int) (dimension.getWidth() - size.getWidth()) / 2; + int y = (int) (dimension.getHeight() - size.getHeight()) / 2; + this.setLocation(x, y); + + this.setLayout(new GridLayout(3, 1)); + + chooseFile = new JButton("选择文件"); + chooseFile.addActionListener(this); + topCount = new JButton("按词频排序前n单词"); + topCount.addActionListener(this); + lenCount = new JButton("按单词长度和词频排序"); + lenCount.addActionListener(this); + + topText = new TextField(10); + lenText = new TextField(10); + + topTip = new JLabel("统计词频前几的单词?"); + lenTip = new JLabel("请输入想统计的单词长度:"); + + + jPanel1 = new JPanel(); + jPanel2 = new JPanel(); + jPanel3 = new JPanel(); + + jPanel1.add(chooseFile); + this.add(jPanel1); + + jPanel2.add(topTip); + jPanel2.add(topText); + jPanel2.add(topCount); + this.add(jPanel2); + + jPanel3.add(lenTip); + jPanel3.add(lenText); + jPanel3.add(lenCount); + this.add(jPanel3); + + this.fileText=""; + this.file = null; + + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + this.setVisible(true); + } + + @Override + public void actionPerformed(ActionEvent e) { + // TODO 自动生成的方法存根 + if(e.getSource() == chooseFile) + { + try { + JFileChooser fc = new JFileChooser(); + fc.setDialogTitle("打开txt文件"); + int result = fc.showOpenDialog(this); // 打开"打开文件"对话框 + // int result = dlg.showSaveDialog(this); // 打"开保存文件"对话框 + if (result == JFileChooser.APPROVE_OPTION) { + file = fc.getSelectedFile(); + } + if(file!=null) + { + FileAdapter fd = new FileAdapter(); + String text = fd.FileToString(file); + this.fileText=text; +// System.out.println(fileText); + if(fileName!=null) + jPanel1.remove(1); + fileName = new JLabel("已选文件名:"+file.getName()); + jPanel1.add(fileName,BorderLayout.WEST); + this.repaint(); + this.validate(); + } + } catch (IOException e1) { + e1.printStackTrace(); + } + } + if(e.getSource() == topCount) + { + if(file != null) + { + if(topText.getText().equals("") || topText.getText()==null) + { + JOptionPane.showMessageDialog(null, "请输入整数确定显示前几单词", "错误", JOptionPane.ERROR_MESSAGE); + } + else if(!isInteger(topText.getText())) + { + JOptionPane.showMessageDialog(null, "请输入整数", "错误", JOptionPane.ERROR_MESSAGE); + } + else { + new CountWordFrame(fileText, 0, Integer.parseInt(topText.getText())); + topText.setText(""); + //this.dispose(); + } + } + else { + JOptionPane.showMessageDialog(null, "请先选择文件!", "错误", JOptionPane.ERROR_MESSAGE); + } + + } + if(e.getSource()==lenCount){ + if(file != null) + { + if(lenText.getText().equals("") || lenText.getText()==null) + { + JOptionPane.showMessageDialog(null, "请输入整数确定显示前几单词", "错误", JOptionPane.ERROR_MESSAGE); + } + else if(!isInteger(lenText.getText())) + { + JOptionPane.showMessageDialog(null, "请输入整数", "错误", JOptionPane.ERROR_MESSAGE); + } + else { + new CountWordFrame(fileText, 1, Integer.parseInt(lenText.getText())); + lenText.setText(""); + //this.dispose(); + } + } + else { + JOptionPane.showMessageDialog(null, "请先选择文件!", "错误", JOptionPane.ERROR_MESSAGE); + } + } + } + public static boolean isInteger(String str) { + Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); + return pattern.matcher(str).matches(); + } +} diff --git a/063/src/wCount/Word.java b/063/src/wCount/Word.java new file mode 100644 index 0000000..6dc51b4 --- /dev/null +++ b/063/src/wCount/Word.java @@ -0,0 +1,96 @@ +package wCount; + +import java.util.*; +import java.util.Map.Entry; + +public class Word +{ + + String text; // 文件中内容 + private int charNum; // 字符个数 + private int wordNum; // 单词总数 + private int lines; // 有效行数 + private Map wordMap; // 单词词频 + + public Word(String text) { + this.text = text;//在构造函数里传入参数为从文件读入的字符串 + } + + public int getCharNum() // 统计文件字符数(ascll码(32~126),制表符,换行符,) + { + char c; + for (int i = 0; i < text.length(); i++) { + c = text.charAt(i); + if (c >= 32 && c <= 126 || c == '\r' || c == '\n'|| c == '\t') { + charNum++; + } + } + return charNum; + } + + + public boolean isWord(String s)//判断是否是单词 + { + if(s.matches("[a-zA-Z]{4}[a-zA-Z0-9]*"))//利用正则表达式判断是否是单词(以4个英文字母开头,跟上字母数字符号,单词以分隔符分割,不区分大小写) + return true; + else + return false; + } + + + //返回一个排序好的存放单词和出现次数的List + public List getSortedWord() // 统计单词词频(单词:以4个英文字母开头,跟上字母数字符号,单词以分隔符分割,不区分大小写。) + { + wordMap = new HashMap(); + String t = text; + + String[] words = t.split("\\s+"); // 对字符串进行分词操作 + for (int i = 0; i < words.length; i++) { + if (isWord(words[i].trim())) { // 如果是单词 + words[i] = words[i].trim().toLowerCase();//转换为小写 + if (wordMap.get(words[i]) == null) { // 判断之前Map中是否出现过该字符串 + wordMap.put(words[i], 1);//没出现过把这个单词作为key放入map,value值设为1 + } else + wordMap.put(words[i], wordMap.get(words[i]) + 1);//出现过value值+1 + } + } + + List> list = new ArrayList>(wordMap.entrySet());//把map的键值对装入一个list中 + list.sort(new Comparator>() {//对list排序 + @Override + public int compare(Entry o1, Entry o2) { //重写compare方法,对list中内容进行排序,先按词频后按字典顺序 + if (o1.getValue() == o2.getValue()) {//如果词频相等 + return o1.getKey().compareTo(o2.getKey());//就按字典序排列 + } + return o2.getValue() - o1.getValue();//否则直接按词频排列 + } + + }); + + return list;//返回排列好后的list + } + + public List getLengthSortedWord(int len) + { + List> list = getSortedWord(); + List> res = new ArrayList<>(); + for(int i=0;i