Welcome to CDG.
This is the Java Constraint Dependency Grammar Parser available on http://nats-www.informatik.uni-hamburg.de/view/CDG/.
Please be aware that this port/reimplementation of cdg to java may be a bit rough around the edges and doesn't have all of the original functions, such as an interactive command line, yet. However, it comes with two GUIs: DepTreeViewer and AnnoViewer.
In DepTreeViewer, you can type a sentence into the input field. It is parsed incrementally (one increment for each new word). The dependency tree, its score and the constraint violations are displayed for every increment. Furthermore, parses can be saved as cda files and cda files can be loaded. The current dependency tree can be exported as SVG.
AnnoViewer can open folders with cda files for viewing and editing. It facilitates annotating sentences, e.g. sentences can be marked as "done". Additionally, several folders with different annotations of the same sentences can be opened in parallel, so that all the dependency trees for one sentence are displayed at the same time.
Please do send us feedback and suggestions or ask for help if you encounter any problems.
Your CDG Team.
firstname.lastname@example.org (You will reach the active project members with this e-mail address)
please consider writing an e-mail to cdg@ before contacting an individual below!
Wolfgang Menzel email@example.com (project leader)
Niels Beuck firstname.lastname@example.org
Christopher Baumgärtner email@example.com
Arne Köhn firstname.lastname@example.org
Christine Köhn email@example.com
See the AUTHORS file for more information on contributors to CDG.
Copyright (C) 1997-2015 The CDG Team firstname.lastname@example.org
jwcdg is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
Please see the file COPYING for details.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You need maven to compile jwcdg. It will get all the requirements automatically.
If you want to use the German grammar bundled with jwcdg, you need to download the lexicon from
and unpack it into the resources/ directory.
The following programs are recommended for running CDG:
A POS tagger with weighted multitagging capabilities:
hunpos (free software)
TnT (nonfree software but better accuracy for multitagging)
Compiling From Source
# change to jwcdg directory cd /path/to/jwcdg/ # clean old files mvn clean # run unit tests mvn test # compile (instead of test if you don't want to run the tests) mvn compile # create an executable jar file containing all dependencies mvn package # create your own configuration file # We recommend to configure one of the taggers above with # "taggerCommand" (see startup.properties) cp startup.properties my-startup.properties emacs my-startup.properties
To run jwcdg non-incrementally, use
java -jar target/jwcdg-1.0.jar my-startup.properties
You can now write sentences and get parses.
The tokens have to be separated by spaces. If you have non-alphanumeric characters, you should enclose that token in single quotes.
Example: '"' Viele 'Michael Jackson-Fans' waren traurig '"' , sagte Petra Musterfrau .
to work with an input/output encoding different to your default system encoding: (example for latin-1)
java -Dfile.encoding=ISO-8859-1 -jar target/jwcdg-1.0.jar my-startup.properties
if you want to use incremental parsing, do this:
java -jar target/jwcdg-1.0.jar --incremental /path/to/output-%1.cda my-startup.properties
jwcdg will now read a sentence from stdin and write the results to /path/to/output-[Number of Increment].cda
To run DepTreeViewer, use
java -cp target/jwcdg-1.0.jar de.unihamburg.informatik.nats.jwcdg.gui.DepTreeViewer -c my-startup.properties
By default, sentences in the input field are parsed incrementally, which can be turned off in the preferences (Edit → Preferences). Tokens have to be separated by spaces. When parsing incrementally, a space character triggers the parsing of the current increment. So, make sure to end your sentence with a space (even after punctuation marks).
To run AnnoViewer, use
java -cp target/jwcdg-1.0.jar de.unihamburg.informatik.nats.jwcdg.gui.AnnoViewer -c my-startup.properties /path/to/folder/with/cda/files
You can specify several folders as arguments if you want to view/edit the annotations for the same sentences simultaneously. If you do so, make sure that the cda files have the same names in each folder.
jwcdg doesn't have an API documentation right now. If you want to include jwcdg into your program, have a look at JWCDG.java, where you can see how one interacts with the different bits of jwcdg (it's really easy!)
Online documentation of CDG is available at http://nats-www.informatik.uni-hamburg.de/view/CDG/CdgManuals.
Please visit our website to have a look at the publications related to CDG at http://nats-www.informatik.uni-hamburg.de/view/CDG/ProjectPublications.