Skip to content

mrdrozdov/turtle-tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turtle Tree Logo

Turtle Tree

Programmatically draw trees over sentences. Supports binary and n-ary trees.

Setup

conda create -n turtle-tree python=3.6 -y
conda activate turtle-tree
pip install PyPDF2
# Built-in for Python 3+
# https://docs.python.org/3/library/turtle.html
# pip install turtle

Usage

# To run some examples.
bash run_examples.sh

Draw trees that take minimal vertical space.

Tree

Tree

python main.py \
    --inp_file examples/examples.jsonl \
    --tree_ids ptb01094,ptb02218 \
    --tree_key tree \
    --prefix demo_run_some \
    --out_dir examples/out

Emphasize edges and text using the input file.

Tree

python main.py \
    --inp_file examples/examples.jsonl \
    --tree_ids ptb01035 \
    --tree_key tree \
    --prefix demo_style \
    --out_dir examples/out

Stitch multiple images together.

Tree

python main.py \
    --inp_file examples/examples.jsonl,examples/examples-2.jsonl \
    --tree_ids ptb01035 \
    --tree_key tree,tree \
    --prefix demo_stitch_1,demo_stitch_2 \
    --out_dir examples/out

About

Python script for drawing parse trees and writing to PDF.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published