Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed the returned results

  • Loading branch information...
commit 38bf1083b024cba4ab06e28a8705b87ba2530029 1 parent be81c64
Paco NATHAN authored
Showing with 13 additions and 10 deletions.
  1. +6 −4 README
  2. +3 −3 build.xml
  3. +4 −3 src/com/sharethis/textrank/TextRank.java
10 README
View
@@ -1,5 +1,7 @@
Open source Java implementation of the TextRank algorithm by Mihalcea, et al.
- http://lit.csci.unt.edu/index.php/Graph-based_NLP
+
+See also:
+ http://lit.csci.unt.edu/index.php/Graph-based_NLP
Paco NATHAN paco@sharethis.com
http://github.com/sharethis/textrank/
@@ -7,14 +9,14 @@ http://github.com/sharethis/textrank/
---------
simple test:
- ant clean compile rank
+ ant run
test with a specific data file FOO.txt
- ant -Ddata.file=FOO.txt clean compile rank
+ ant -Ddata.file=FOO.txt run
build the JAR for export to another project:
- ant clean compile jar
+ ant jar
---------
6 build.xml
View
@@ -2,7 +2,7 @@
<project
name="textrank"
- default="rank"
+ default="run"
basedir="."
>
<description>
@@ -142,8 +142,8 @@ http://github.com/sharethis/textrank/
<target
- name="rank"
- description="misc. testing"
+ name="run"
+ description="run the algorithm on a text document"
depends="compile"
>
<property
7 src/com/sharethis/textrank/TextRank.java
View
@@ -43,6 +43,7 @@
import java.io.OutputStreamWriter;
import java.io.Reader;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -68,7 +69,7 @@
public class
TextRank
- implements Callable<Map<NGram, MetricVector>>
+ implements Callable<Collection<MetricVector>>
{
// logging
@@ -142,7 +143,7 @@
* build a graph of weighted key phrases.
*/
- public Map<NGram, MetricVector>
+ public Collection<MetricVector>
call ()
throws Exception
{
@@ -306,7 +307,7 @@ else if (lang.isAdjective(kw.pos)) {
// return results
- return metric_space;
+ return metric_space.values();
}
Please sign in to comment.
Something went wrong with that request. Please try again.