#!/usr/bin/perl
# PODNAME: actants
# ABSTRACT: command line interface for Lingua::PT::Actants

use warnings;
use strict;
binmode(STDOUT, ":utf8");

use Lingua::PT::Actants;
use Path::Tiny;

my $input;

my $file = shift;
if ($file) {
  $input = path($file)->slurp_utf8;
}
else {
  $input = join('', <STDIN>);
}

unless ($input) {
  print "Usage: actants <input>\n";
  exit;
}

my $o = Lingua::PT::Actants->new( conll => $input );
my ($cores, $ranks) = $o->acts_cores;
my $acts = $o->actants;

print $o->text, "\n\n",
        $o->pp_acts_syntagmas($acts), "\n",
          $o->pp_acts_cores($cores), "\n",
            $o->pp_acts_ranks($ranks);

__END__

=pod

=encoding UTF-8

=head1 NAME

actants - command line interface for Lingua::PT::Actants

=head1 VERSION

version 0.03

=head1 AUTHOR

Nuno Carvalho <smash@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2016-2017 by Nuno Carvalho.

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

=cut
