Commit 5ea861ef authored by Arne Köhn's avatar Arne Köhn

small cleanups & README

parent 53ab8713
......@@ -5,3 +5,5 @@
/.gradle/
*.conll
*.svg
.#*
*#
Deptreeviz -- produce good looking dependency trees
===================================================
deptreeviz – a library to view and edit dependency trees
========================================================
This library allows you to easily generate dependency tree SVGs. You
can even use a swing widget with interactivity to manipulate dependency trees.
We at [NatS](https://nats-www.informatik.uni-hamburg.de) have a long
history of visualizing dependency trees. This library is a spin-off
from our dependency parser [jwcdg](https://gitlab.com/nats/jwcdg),
which comes with its own editing and visualization tools.
The edges don't need to form a tree and you can visualize several
annotations at once, e.g. syntactic and anaphora edges at the same time.
The trees look like this:
If you build this library with "gradle shadowJar", the resulting jar
converts a conll file to SVG by default.
![example tree](examples/ralston-purina.svg)
java -jar build/libs/deptreeviz-VERSION-all.jar sentence.conll > sentence.svg
The library can also cope with circular annotations:
```
1 circles circles NOUN NOUN _ 1 root _ _
2 are are VERB VERB _ 3 dobj _ _
3 very very ADJ ADJ _ 4 dobj _ _
4 bad bad ADJ ADJ _ 2 dobj _ _
```
yields this:
![circular annotation](examples/circular.svg)
Usage as a program
------------------
Simply clone this repository, build it with
```./gradlew shadowJar```
and run ```java -jar build/libs/deptreeviz-0.3.0.dirty-all.jar``` with
either two arguments (conll in, svg out) or without arguments and pipe
your conll to stdin and get the svg with stdout.
Usage as a library
------------------
src/main/java/io/gitlab/nats/deptreeviz/ConllToSVG.java
shows the basic usage. More documentation might be on the way,
especially a demo for swing integration and editing trees using a GUI.
Features not well documented:
- edge highlighting
- displaying additional node info (PoS etc.)
- displaying multiple layers of annotation, e.g.syntax and
referential reliations
Authors and license
-------------------
This Code was mainly written by Sven Zimmer. Arne Köhn extracted the
library from the jwcdg code.
This library is licensed under the Apache License, Version 2.0.
Patches welcome!
......@@ -20,10 +20,7 @@ repositories {
}
dependencies {
compile group:'org.apache.xmlgraphics', name:'batik-awt-util', version:'1.8'
compile group:'org.apache.xmlgraphics', name:'batik-svggen', version:'1.8'
compile group:'org.apache.xmlgraphics', name:'batik-ext', version:'1.8'
compile group:'org.apache.xmlgraphics', name:'batik-svg-dom', version:'1.8'
compile group:'org.apache.xmlgraphics', name:'batik-swing', version:'1.8'
compile group:'org.apache.xmlgraphics', name:'xmlgraphics-commons', version:'2.2'
}
......@@ -67,10 +64,6 @@ uploadArchives {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
// snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
// authentication(userName: ossrhUsername, password: ossrhPassword)
// }
pom.project {
packaging 'jar'
name 'deptreeviz'
......@@ -99,4 +92,3 @@ uploadArchives {
}
}
}
1 circles circles NOUN NOUN _ 1 root _ _
2 are are VERB VERB _ 3 dobj _ _
3 very very ADJ ADJ _ 4 dobj _ _
4 bad bad ADJ ADJ _ 2 dobj _ _
This diff is collapsed.
1 Ralston _ NN NNP _ 2 NAME _ _
2 Purina _ NN NNP _ 4 SBJ _ _
3 Co. _ NN NNP _ 2 POSTHON _ _
4 reported _ VB VBD _ 0 ROOT _ _
5 a _ DT DT _ 8 NMOD _ _
6 47 _ CD CD _ 7 AMOD _ _
7 % _ NN NN _ 8 NMOD _ _
8 decline _ NN NN _ 4 OBJ _ _
9 in _ IN IN _ 8 NMOD _ _
10 fourth-quarter _ NN NN _ 11 NMOD _ _
11 earnings _ NN NNS _ 9 PMOD _ _
12 , _ , , _ 4 P _ _
13 reflecting _ VB VBG _ 4 ADV _ _
14 restructuring _ NN NN _ 15 NMOD _ _
15 costs _ NN NNS _ 13 OBJ _ _
16 as _ RB RB _ 15 COORD _ _
17 well _ RB RB _ 16 DEP _ _
18 as _ IN IN _ 16 DEP _ _
19 a _ DT DT _ 24 NMOD _ _
20 more _ RB RBR _ 21 AMOD _ _
21 difficult _ JJ JJ _ 24 NMOD _ _
22 pet _ NN NN _ 23 NMOD _ _
23 food _ NN NN _ 24 NMOD _ _
24 market _ NN NN _ 16 CONJ _ _
25 . _ . . _ 4 P _ _
This diff is collapsed.
#Tue Feb 14 14:36:58 CET 2017
#Fri Mar 31 14:43:22 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment