Skip to content

Commit

Permalink
changed the returned results
Browse files Browse the repository at this point in the history
  • Loading branch information
Paco NATHAN committed Apr 30, 2009
1 parent be81c64 commit 38bf108
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
10 changes: 6 additions & 4 deletions README
@@ -1,20 +1,22 @@
Open source Java implementation of the TextRank algorithm by Mihalcea, et al. 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 Paco NATHAN paco@sharethis.com
http://github.com/sharethis/textrank/ http://github.com/sharethis/textrank/


--------- ---------


simple test: simple test:
ant clean compile rank ant run


test with a specific data file FOO.txt 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: build the JAR for export to another project:
ant clean compile jar ant jar


--------- ---------


Expand Down
6 changes: 3 additions & 3 deletions build.xml
Expand Up @@ -2,7 +2,7 @@


<project <project
name="textrank" name="textrank"
default="rank" default="run"
basedir="." basedir="."
> >
<description> <description>
Expand Down Expand Up @@ -142,8 +142,8 @@ http://github.com/sharethis/textrank/




<target <target
name="rank" name="run"
description="misc. testing" description="run the algorithm on a text document"
depends="compile" depends="compile"
> >
<property <property
Expand Down
7 changes: 4 additions & 3 deletions src/com/sharethis/textrank/TextRank.java
Expand Up @@ -43,6 +43,7 @@ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import java.io.Reader; import java.io.Reader;


import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map; import java.util.Map;
Expand All @@ -68,7 +69,7 @@ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT


public class public class
TextRank TextRank
implements Callable<Map<NGram, MetricVector>> implements Callable<Collection<MetricVector>>
{ {
// logging // logging


Expand Down Expand Up @@ -142,7 +143,7 @@ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* build a graph of weighted key phrases. * build a graph of weighted key phrases.
*/ */


public Map<NGram, MetricVector> public Collection<MetricVector>
call () call ()
throws Exception throws Exception
{ {
Expand Down Expand Up @@ -306,7 +307,7 @@ else if (lang.isAdjective(kw.pos)) {


// return results // return results


return metric_space; return metric_space.values();
} }




Expand Down

0 comments on commit 38bf108

Please sign in to comment.