From 27b9a9b1120a73d8245b8a1b2b93a6a8c225dd4d Mon Sep 17 00:00:00 2001 From: amir-zeldes Date: Fri, 30 Apr 2021 11:19:56 -0400 Subject: [PATCH] README --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f5c8ab..a702af2 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A simple configurable tool for manipulating dependency trees. -DepEdit reads and writes files encoded in the CoNLLX or CoNLLU dependency format (10 columns). It's a simple Python script which can change token attributes, token text, part of speech dependency function and other columns, as well as rewiring dependency graphs based on rules. You can also use it to add annotations to each sentence based on properties of the subgraph (see the English example of tagging rough sentence type in examples/) +DepEdit reads and writes files encoded in the CoNLL-U or CoNLL-X dependency format (10 columns). It's a simple Python script which can change token attributes, token text, part of speech dependency function and other columns, as well as rewiring dependency graphs based on rules. You can also use it to add annotations to each sentence based on properties of the subgraph (see the English example of tagging rough sentence type in examples/) To use the script, either copy the file `depedit/depedit.py` into your project, or install it from PyPI: @@ -10,6 +10,18 @@ To use the script, either copy the file `depedit/depedit.py` into your project, pip install depedit ``` +You can then run it directly or as a module: + +``` +If depedit is in the current directory: + +> python depedit.py -c CONFIG.ini INFILE.conllu + +Or if installed via pip or setup.py, then in any directory: + +> python -m depedit -c CONFIG.ini INFILE.conllu +``` + ## Basic usage ``` @@ -20,7 +32,7 @@ usage: depedit.py [-h] [-c CONFIG] [-d] [-s] [-k {supertoks,comments,both}] positional arguments: file Input single file name or glob pattern to process a - batch (e.g. *.conll10) + batch (e.g. *.conllu) optional arguments: -h, --help show this help message and exit @@ -28,6 +40,7 @@ optional arguments: Configuration file defining transformation -d, --docname Begin output with # newdoc id =... -s, --sent_id Add running sentence ID comments + -t, --text Add # text =... -k {supertoks,comments,both}, --kill {supertoks,comments,both} Remove supertokens or commments from output -q, --quiet Do not output warnings and messages