CWB-CQP-More

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Test::Pod::Coverage" : "1.08"
         }
      },
      "runtime" : {
         "requires" : {
            "CWB" : "0",
            "Carp" : "0",
            "Data::Dumper" : "0",
            "Encode" : "0",
            "POSIX::Open3" : "0",
            "Try::Tiny" : "0",
            "base" : "0",
            "parent" : "0",
            "perl" : "5.006",
            "strict" : "0",
            "warnings" : "0"
         }
      },
      "test" : {
         "requires" : {
            "Test::More" : "0"

META.yml  view on Meta::CPAN

meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: CWB-CQP-More
requires:
  CWB: '0'
  Carp: '0'
  Data::Dumper: '0'
  Encode: '0'
  POSIX::Open3: '0'
  Try::Tiny: '0'
  base: '0'
  parent: '0'
  perl: '5.006'
  strict: '0'
  warnings: '0'
resources:
  repository: https://natura.di.uminho.pt/svn/main/CWB-CQP-More/
version: '0.08'

Makefile.PL  view on Meta::CPAN

  "DISTNAME" => "CWB-CQP-More",
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.006",
  "NAME" => "CWB::CQP::More",
  "PREREQ_PM" => {
    "CWB" => 0,
    "Carp" => 0,
    "Data::Dumper" => 0,
    "Encode" => 0,
    "POSIX::Open3" => 0,
    "Try::Tiny" => 0,
    "base" => 0,
    "parent" => 0,
    "strict" => 0,
    "warnings" => 0
  },
  "TEST_REQUIRES" => {
    "Test::More" => 0
  },
  "VERSION" => "0.08",
  "test" => {

Makefile.PL  view on Meta::CPAN

);


my %FallbackPrereqs = (
  "CWB" => 0,
  "Carp" => 0,
  "Data::Dumper" => 0,
  "Encode" => 0,
  "POSIX::Open3" => 0,
  "Test::More" => 0,
  "Try::Tiny" => 0,
  "base" => 0,
  "parent" => 0,
  "strict" => 0,
  "warnings" => 0
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};
  delete $WriteMakefileArgs{BUILD_REQUIRES};

lib/CWB/CQP/More.pm  view on Meta::CPAN

package CWB::CQP::More;
$CWB::CQP::More::VERSION = '0.08';
use parent CWB::CQP;
use CWB;

use Carp;
use Try::Tiny;
use Encode;
use warnings;
use strict;
use POSIX::Open3;
use CWB::CQP::More::Iterator;

our $DEBUG = 0;

sub import {
    my @ops = @_;

lib/CWB/CQP/More.pm  view on Meta::CPAN


    my $cqp = CWB::CQP::More->new( { utf8 => 1 } );

    $cqp->change_corpus('HANSARDS');

    # This needs to get fixed... not nice to say "'<b>'"
    $cqp->set(Context  => [20, 'words'],
              LD       => "'<b>'",
              RD       => "'</b>'");

    # using Try::Tiny...
    try {
        $cqp->exec('A = "dog";');
        my $result_size = $cqp->size('A');
        my @lines = $cqp->cat('A');
    } catch {
        print "Error: $_\n";
    }

    $cqp->annotation_show("pos");

lib/CWB/CQP/More.pm  view on Meta::CPAN


        try {
            $self->exec("set $key $values;");
        };
    }
}

=head2 exec

Similar to CWB::CQP->exec, but dying in case of error with the error
message. Useful for use with C<Try::Tiny>. Check the synopsis above
for an example.

=cut

sub exec {
    my ($self, @args) = @_;
    @args = map { Encode::_utf8_off($_); $_ } @args if $self->{__utf8};
    print STDERR join(' || ', @args), "\n" if $DEBUG;
    my @answer = $self->SUPER::exec(@args);
    die $self->error_message unless $self->ok;

lib/CWB/CQP/More/Parallel.pm  view on Meta::CPAN

package CWB::CQP::More::Parallel;
$CWB::CQP::More::Parallel::VERSION = '0.08';
use 5.006;
use strict;
use warnings;

use base 'CWB::CQP::More';
use Try::Tiny;

=encoding utf-8

=head1 NAME

CWB::CQP::More::Parallel - CWP::CQP::More tweaked for parallel corpora

=head1 SYNOPSIS

   use CWB::CQP::More::Parallel;



( run in 0.590 second using v1.01-cache-2.11-cpan-05444aca049 )