Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
183 lines (162 sloc) 2.98 KB
<?xml version="1.0" encoding="UTF-8"?>
<project
name="textrank"
default="run"
basedir="."
>
<description>
Ant build script for
Open source Java implementation of the TextRank algorithm by Mihalcea, et al.
http://lit.csci.unt.edu/index.php/Graph-based_NLP
Paco NATHAN paco@sharethis.com
http://github.com/sharethis/textrank/
</description>
<!-- property settings -->
<property
name="src.dir"
location="${basedir}"
/>
<property
name="lib.dir"
location="${basedir}/lib"
/>
<property
name="build.dir"
location="${basedir}/classes"
/>
<property
name="res.dir"
location="${basedir}/res"
/>
<property
name="docs.dir"
location="${basedir}/docs/api"
/>
<property
name="text.data"
location="${basedir}/data.txt"
/>
<property
name="app.jar"
location="${basedir}/textrank.jar"
/>
<!-- classpath definitions -->
<path
id="base.path"
>
</path>
<path
id="compile.classpath"
>
<path
refid="base.path"
/>
<pathelement
path="${src.dir}"
/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement
path="${basedir}"
/>
</path>
<path
id="build.classpath"
>
<pathelement
location="${build.dir}"
/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<!--
######################################################################
target definitions:
lifecycle tasks - clean, compile, commit, etc.
######################################################################
-->
<target
name="clean"
description="remove temporary files"
>
<defaultexcludes remove="**/*~"/>
<delete>
<fileset dir=".">
<include name="**/*~"/>
</fileset>
</delete>
<delete dir="${build.dir}"/>
<delete file="${app.jar}"/>
<delete dir="${docs.dir}"/>
<delete file="${basedir}/graph.tsv"/>
</target>
<target
name="compile"
description="compile all Java classes"
depends="clean"
>
<mkdir dir="${build.dir}"/>
<javac
classpathref="build.classpath"
destdir="${build.dir}"
debug="on"
deprecation="on"
>
<compilerarg value="-Xlint:unchecked"/>
<src path="${src.dir}"/>
</javac>
</target>
<target
name="jar"
description="build a JAR"
depends="compile"
>
<jar
destfile="${app.jar}"
basedir="${build.dir}"
>
<manifest>
<attribute name="Main-Class" value="com.sharethis.textrank.TextRank"/>
</manifest>
</jar>
</target>
<target
name="run"
description="run the algorithm on a text document"
depends="compile"
>
<property
name="data.file"
location="${basedir}/test/good.txt"
/>
<property
name="lang.code"
value="en"
/>
<property
name="graph.file"
location="${basedir}/graph.tsv"
/>
<java
classname="com.sharethis.textrank.TextRank"
fork="true"
>
<classpath>
<pathelement location="${build.dir}"/>
<!-- Project classes and tests -->
<path refid="compile.classpath"/>
<!-- All jars -->
</classpath>
<!--
<sysproperty key="nlp.resources" value="${res.dir}"/>
-->
<arg value="${res.dir}/log4j.properties"/>
<arg value="${res.dir}"/>
<arg value="${lang.code}"/>
<arg value="${data.file}"/>
<arg value="${graph.file}"/>
</java>
</target>
</project>