Skip to content

Commit

Permalink
初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Oct 9, 2014
1 parent b65199d commit e22b7f3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public int compare(PairFrequency o1, PairFrequency o2)

public void addAll(List<WordResult> resultList)
{
System.out.println(resultList);
// System.out.println(resultList);
String[] termList = new String[resultList.size()];
int i = 0;
for (WordResult word : resultList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ public List<String> exactPhrase(String text, int size)
occurrence.addAll(sentence);
}
occurrence.compute();
System.out.println(occurrence);
for (PairFrequency phrase : occurrence.getPhraseByMi())
{
System.out.print(phrase.getKey().replace(Occurrence.RIGHT, '→') + "\tmi=" + phrase.mi + " , ") ;
}
System.out.println();
for (PairFrequency phrase : occurrence.getPhraseByLe())
{
System.out.print(phrase.getKey().replace(Occurrence.RIGHT, '→') + "\tle=" + phrase.le + " , ");
}
System.out.println();
for (PairFrequency phrase : occurrence.getPhraseByRe())
{
System.out.print(phrase.getKey().replace(Occurrence.RIGHT, '→') + "\tre=" + phrase.re + " , ");
}
System.out.println();
for (PairFrequency phrase : occurrence.getPhraseByScore())
{
System.out.print(phrase.getKey().replace(Occurrence.RIGHT, '→') + "\tscore=" + phrase.score + " , ");
}
System.out.println();
// System.out.println(occurrence);
// for (PairFrequency phrase : occurrence.getPhraseByMi())
// {
// System.out.print(phrase.getKey().replace(Occurrence.RIGHT, '→') + "\tmi=" + phrase.mi + " , ") ;
// }
// System.out.println();
// for (PairFrequency phrase : occurrence.getPhraseByLe())
// {
// System.out.print(phrase.getKey().replace(Occurrence.RIGHT, '→') + "\tle=" + phrase.le + " , ");
// }
// System.out.println();
// for (PairFrequency phrase : occurrence.getPhraseByRe())
// {
// System.out.print(phrase.getKey().replace(Occurrence.RIGHT, '→') + "\tre=" + phrase.re + " , ");
// }
// System.out.println();
// for (PairFrequency phrase : occurrence.getPhraseByScore())
// {
// System.out.print(phrase.getKey().replace(Occurrence.RIGHT, '→') + "\tscore=" + phrase.score + " , ");
// }
// System.out.println();
for (PairFrequency phrase : occurrence.getPhraseByScore())
{
if (phraseList.size() == size) break;
Expand Down Expand Up @@ -86,8 +86,8 @@ public static void main(String[] args)
"在通信物理层等一维信息领域目前常用的算法:无线领域的RRM、RTT,传送领域的调制解调、信道均衡、信号检测、网络优化、信号分解等。\n" +
"另外数据挖掘、互联网搜索算法也成为当今的热门方向。\n" +
"算法工程师逐渐往人工智能方向发展。";
System.out.println(text);
List<String> phraseList = exactor.exactPhrase(text, 5);
// System.out.println(text);
List<String> phraseList = exactor.exactPhrase(text, 10);
System.out.println(phraseList);
}
}

0 comments on commit e22b7f3

Please sign in to comment.