The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!/usr/bin/env perl

# temporary script for running TrEd on treex files using the new extension

# can't use runtred, as it runs setup_platform and thus destroys PERLLIBS

use strict;
use warnings;

use Treex::Core::Log;
use Treex::Core::Config;

my $tred_dir = Treex::Core::Config->tred_dir();
log_fatal('TrEd not installed or tred_dir not set') if !defined $tred_dir;
my $tred_extension_dir = Treex::Core::Config->tred_extension_dir();
log_fatal('TrEd extension dir not set') if !defined $tred_extension_dir;

my $command =  $tred_dir
    . '/tred -O PreInstalledExtensionsDir='
    . $tred_extension_dir
#    . ' -O MaxUndo=0 '
    . ' -B Treex::Core::TredView::BackendStorable ' # extra backends
    . ' -J* '
    . ' -j treex '
    . (join ' ',@ARGV);

print "Running TrEd customized for Treex:\n$command\n";

system $command;


1;

__END__

=encoding utf-8

=head1 NAME

ttred - running TrEd customized for browsing treex files

=head1 VERSION

version 0.08663

=head1 DESCRIPTION

This script executes the tree editor TrEd (by Petr Pajas)
customized for the PML data format generated by Treex::Core modules.
Visualization defined is Treex::Core::TredView is used.

=head1 AUTHOR

Zdeněk Žabokrtský <zabokrtsky@ufal.mff.cuni.cz>


=head1 COPYRIGHT AND LICENSE

Copyright © 2011 by Institute of Formal and Applied Linguistics, Charles University in Prague

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.