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

use warnings;
use strict;

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

my $input;

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

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

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

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

__END__

=pod

=encoding UTF-8

=head1 NAME

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

=head1 VERSION

version 0.02

=head1 AUTHOR

Nuno Carvalho <smash@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2016 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
