view release on metacpan or search on metacpan
bin/linkBags view on Meta::CPAN
my $SORTCODE = "LC_ALL=en_US.UTF-8; export LC_ALL;" ;
############ END CONFIGURATION ######################
# autoflush
select((select(STDERR), $| = 1)[0]);
# encoding pragmas follow any includes like "use"
use encoding 'utf8';
use open ':utf8';
binmode STDIN, ":utf8";
bin/linkBags view on Meta::CPAN
close(IN);
close(OUT);
# we want to write to the front of the file,
# without destroying rest of contents, this open does it
sysopen(OUT, $tfile, O_RDWR) or die "Cannot reopen $tfile: $!";
my $oldfh = select(OUT); $| = 1; select($oldfh);
# now, rewrite header
print OUT sprintf("%8d\n%8d\n", $doccount, $featcount);
close(OUT);
print STDERR "\nNow build the document bags with mpdata\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/Buffer.pm view on Meta::CPAN
# start new one
if ( ! open(ABUF,">>$BUFFER") ) {
print STDERR "Cannot open $BUFFER: $!\n";
return 0;
}
select((select(ABUF), $| = 1)[0]);
print ABUF $HEADER;
} else {
# check old one first
if ( ! open(ABUF,"<$BUFFER") ) {
print STDERR "Cannot open $BUFFER: $!\n";
lib/Alvis/Buffer.pm view on Meta::CPAN
# now open for append
if ( ! open(ABUF,">>$BUFFER") ) {
print STDERR "Cannot open $BUFFER: $!\n";
return 0;
}
select((select(ABUF), $| = 1)[0]);
}
1;
}
############################################
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/NLPPlatform/NLPWrappers.pm view on Meta::CPAN
my %corpus;
my %lc_corpus;
my $sent_id;
my $command_line;
my %corpus_index;
my %idtrm_select;
my @tab_results;
my $semtag;
my $token_start;
my $token_end;
lib/Alvis/NLPPlatform/NLPWrappers.pm view on Meta::CPAN
if (scalar(@term_list_FR) == 0) {
Alvis::TermTagger::load_TermList($h_config->{'NLP_misc'}->{'TERM_LIST_FR'},\@term_list_FR);
Alvis::TermTagger::get_Regex_TermList(\@term_list_FR, \@regex_term_list_FR);
}
Alvis::TermTagger::corpus_Indexing(\%lc_corpus, \%corpus_index);
Alvis::TermTagger::term_Selection(\%corpus_index, \@term_list_FR, \%idtrm_select);
Alvis::TermTagger::term_tagging_offset_tab(\@term_list_FR, \@regex_term_list_FR, \%idtrm_select, \%corpus, \%tabh_sent_terms);
} else {
if (scalar(@term_list_EN) == 0) {
Alvis::TermTagger::load_TermList($h_config->{'NLP_misc'}->{'TERM_LIST_EN'},\@term_list_EN);
Alvis::TermTagger::get_Regex_TermList(\@term_list_EN, \@regex_term_list_EN);
}
Alvis::TermTagger::corpus_Indexing(\%lc_corpus, \%corpus_index);
Alvis::TermTagger::term_Selection(\%corpus_index, \@term_list_EN, \%idtrm_select);
Alvis::TermTagger::term_tagging_offset_tab(\@term_list_EN, \@regex_term_list_EN, \%idtrm_select, \%corpus, \%tabh_sent_terms);
}
%lc_corpus = ();
%corpus_index = ();
%idtrm_select = ();
%corpus = ();
# TODO : taking into account the case where terms appear at least twice in a sentence
$i=0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alvis/Treetagger.pm view on Meta::CPAN
}
sleep(1);
if ( $verbose ) { print STDERR "Starting fifo input $FIFO.in\n"; }
open(FI,">$FIFO.in");
select((select(FI), $| = 1)[0]);
# send some stuff down the pipe to warm it up;
# note we add to extra "\n." two evey message
# to force TreeTagger to run the buffer
print FI "Start\nup\nnow\n.\n.\n.\n";
view all matches for this distribution
view release on metacpan or search on metacpan
bin/TermTagger-brat.pl view on Meta::CPAN
TermTagger-brat.pl -- A Perl script for tagging text with terms (Brat format output)
=head1 SYNOPSIS
TermTagger.pl [options] corpus termlist selected_term_list lemmatised_corpus
=head1 OPTIONS
=over 4
bin/TermTagger-brat.pl view on Meta::CPAN
This script tags a corpus with terms and provide a output compatible with Brat (<http://brat.nlplab.org/>). Corpus (C<corpus>) is a file
with one sentence per line. Term list (C<termlist>) is a file
containing one term per line. For each term, additionnal information
(as canonical form) can be given after a column. Each line of the
output file (C<selected_term_list>) contains the sentence number, the
term, additional information, all separated by a tabulation character.
==hea1 EXAMPLES
Tag the textual corpus in C<corpus-test.txt> with terms in the file
view all matches for this distribution
view release on metacpan or search on metacpan
my $default = $config->{mason_web_dir};
$default =~ s,/alzabo\Z,, if $default;
do
{
print "\n *** The directory you selected does not exist ***\n"
if defined $config->{mason_web_dir} && ! -d $config->{mason_web_dir};
print <<'EOF';
Where would you like to install the mason components for this
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alzabo/Driver.pm view on Meta::CPAN
Returns an array of array references containing the data requested.
=head2 rows_hashref
Returns an array of hash references containing the data requested.
The hash reference keys are the columns being selected. All the key
names are in uppercase.
=head2 one_row
Returns an array or scalar containing the data returned, depending on
context.
=head2 one_row_hash
Returns a hash containing the data requested. The hash keys are the
columns being selected. All the key names are in uppercase.
=head2 column
Returns an array containing the values for the first column of each
row returned.
lib/Alzabo/Driver.pm view on Meta::CPAN
Throws: L<C<Alzabo::Exception::Driver>|Alzabo::Exceptions>
=head2 all_rows
If the select for which this statement is cursor was for a single
column (or aggregate value), then this method returns an array
containing each B<remaining> value from the database.
Otherwise, it returns an array of array references, each one
containing a returned row from the database.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/Dash/Button.pm view on Meta::CPAN
The first thing to do once you have received your button is to set it and discover it.
Here is the basic setting process:
=over 4
=item use your phone or table to perform the basic setting, but do not complete it, stop when asking to select to link a product with the button.
=item in the mobile app you would find a menu "Your Dash Button" -> "Settings" then "Set up a new device".
=item choose your dash device, then follow the instructions: long press on the button until it discovery mode (blue light)
=item provide the wifi password of your network
=item but do not select the exact product linked to your button exit from there !
=back
=head2 Detecting the button
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/DynamoDB/Simple.pm view on Meta::CPAN
$table->keys();
# delete $old_key, create $new_key
$table->rename($old_key, $new_key);
# sync data between AWS regions using the 'last_updated' field to select
# the newest data. This method will permanently delete any items marked as
# 'deleted'.
$table->sync_regions();
# This sets the value of the hosts attribute. The value shown is the
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/DynamoDB/LWP.pm view on Meta::CPAN
sub delay {
my $self = shift;
my $amount = shift;
Future->call(sub {
# Sleep could be less than one second, so use select.
if ($amount > 0) {
select(undef, undef, undef, $amount);
}
Future->new->done();
});
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
}
=item force
Same as above, but only for the selected items. An arrayref is
expected here with the B<skus>.
=cut
has force => (is => 'ro',
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
has existing_products => (is => 'lazy');
sub _build_existing_products {
my $self = shift;
my $sth = $self->_exe_query($self->sqla->select(amazon_mws_products => [qw/sku
timestamp_string
status
listed
error_code
/],
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
status => 'pending',
warnings => '', # clear out
timestamp_string => $p->timestamp_string,
);
my $check = $self
->_exe_query($self->sqla->select(amazon_mws_products => [qw/sku/], { %identifier }));
my $existing = $check->fetchrow_hashref;
$check->finish;
if ($existing) {
$self->_exe_query($self->sqla->update(amazon_mws_products => \%data, \%identifier));
}
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
}
}
if (@named_jobs) {
$additional{amws_job_id} = { -in => \@named_jobs };
}
my ($stmt, @bind) = $self->sqla->select(amazon_mws_jobs => '*',
{
%additional,
aborted => 0,
success => 0,
shop_id => $self->_unique_shop_id,
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
# upload the feeds one by one and stop if something is blocking
my $job_id = $row->{amws_job_id};
print "Processing job $job_id\n";
# query the feeds table for this job
my ($stmt, @bind) = $self->sqla->select(amazon_mws_feeds => '*',
{
amws_job_id => $job_id,
aborted => 0,
success => 0,
shop_id => $self->_unique_shop_id,
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
while (my $feed = $sth->fetchrow_hashref) {
last unless $self->upload_feed($feed);
}
$sth->finish;
($stmt, @bind) = $self->sqla->select(amazon_mws_feeds => '*',
{
shop_id => $self->_unique_shop_id,
amws_job_id => $job_id,
});
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
=cut
sub order_already_registered {
my ($self, $order) = @_;
die "Bad usage, missing order" unless $order;
my $sth = $self->_exe_query($self->sqla->select(amazon_mws_orders => '*',
{
amazon_order_id => $order->amazon_order_number,
shop_id => $self->_unique_shop_id,
}));
if (my $exists = $sth->fetchrow_hashref) {
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
print "Trying to purge missing items " . join(" ", @skus) . "\n";
# delete only products which are not in pending status
my $check = $self
->_exe_query($self->sqla
->select('amazon_mws_products', [qw/sku status/],
{
sku => { -in => \@skus },
shop_id => $self->_unique_shop_id,
}));
my %our_skus;
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
}
else {
warn "register_order_ack_errors couldn't parse " . Dumper($result);
}
# then get the amazon order number and recheck
my $sth = $self->_exe_query($self->sqla->select('amazon_mws_orders',
[qw/amazon_order_id
shop_order_id
/],
{
amws_job_id => $job_id,
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
=cut
sub skus_in_job {
my ($self, $job_id) = @_;
my $sth = $self->_exe_query($self->sqla->select('amazon_mws_products',
[qw/sku/],
{
amws_job_id => $job_id,
shop_id => $self->_unique_shop_id,
}));
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
=cut
sub order_already_shipped {
my ($self, $order) = @_;
my $condition = $self->_condition_for_shipped_orders($order);
my $sth = $self->_exe_query($self->sqla->select(amazon_mws_orders => '*', $condition));
if (my $row = $sth->fetchrow_hashref) {
die "Multiple results found in amazon_mws_orders for " . Dumper($condition)
if $sth->fetchrow_hashref;
return $row;
}
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
=cut
sub orders_waiting_for_shipping {
my $self = shift;
my $sth = $self->_exe_query($self->sqla->select('amazon_mws_orders',
[qw/amazon_order_id
shop_order_id/],
{
shop_id => $self->_unique_shop_id,
shipping_confirmation_job_id => undef,
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
=cut
sub orders_in_shipping_job {
my ($self, $job_id) = @_;
die unless $job_id;
my $sth = $self->_exe_query($self->sqla->select(amazon_mws_orders => [qw/amazon_order_id/],
{
shipping_confirmation_job_id => $job_id,
shop_id => $self->_unique_shop_id,
}));
my @orders;
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
);
# check if we have it
my $sth = $self->_exe_query($self->sqla
->select('amazon_mws_products',
[qw/sku/], { %identifier }));
if ($sth->fetchrow_hashref) {
$sth->finish;
print "Updating $product{sku} with error $product{error_msg}\n";
$self->_exe_query($self->sqla->update('amazon_mws_products',
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
sub cancel_feed {
my ($self, $feed) = @_;
die "Missing feed id argument" unless $feed;
# do the api call
my $sth = $self->_exe_query($self->sqla
->select(amazon_mws_feeds => [qw/amws_job_id/],
{
shop_id => $self->_unique_shop_id,
feed_id => $feed,
aborted => 0,
success => 0,
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
sub update_amw_order_status {
my ($self, $order) = @_;
# first, check if it exists
return unless $order;
my $sth = $self->_exe_query($self->sqla->select('amazon_mws_orders',
'*',
{
amazon_order_id => $order,
shop_id => $self->_unique_shop_id,
}));
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
my $where = { '>' => 0 };
if (@errcodes) {
$where = { -in => \@errcodes };
}
my $sth = $self->_exe_query($self->sqla
->select('amazon_mws_products', '*',
{
status => { '!=' => 'deleted' },
shop_id => $self->_unique_shop_id,
error_code => $where,
},
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
}
sub get_products_with_warnings {
my $self = shift;
my $sth = $self->_exe_query($self->sqla
->select('amazon_mws_products', '*',
{
status => 'ok',
shop_id => $self->_unique_shop_id,
warnings => { '!=' => '' },
},
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
if (my $shop_id = $self->shop_id) {
push @and, shop_id => $shop_id;
}
my $sth = $self->_exe_query($self->sqla
->select(amazon_mws_jobs => [qw/amws_job_id shop_id/],
[ -and => \@and ] ));
my @purge_jobs;
my $count = 0;
while (my $where = $sth->fetchrow_hashref) {
if ($limit) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/S3/Thin.pm view on Meta::CPAN
of your credentials.
=item * C<version> (B<OPTIONAL [provider: metadata]>) - version of metadata service to use, either 1 or 2.
L<read more|https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html>
=item * C<role> (B<OPTIONAL [provider: metadata]>) - IAM instance role to use, otherwise the first is selected
=item * C<secure> - whether to use https or not. Default is 0 (http).
=item * C<ua> - a user agent object, compatible with LWP::UserAgent.
Default is an instance of L<LWP::UserAgent>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/S3.pm view on Meta::CPAN
When an upload is performed through L<Amazon::S3::Bucket>,
C<Amazon::S3> calculates the configured checksum when that operation
supports checksum submission.
The checksum algorithm is selected using C<checksum_algorithm>. The
default is C<crc64nvme>.
Managed multipart uploads performed by
C<Amazon::S3::Bucket::upload_multipart_object()> also use the
configured checksum algorithm.
Low-level multipart methods do not implicitly enable an additional
checksum algorithm. Applications that directly manage the multipart
workflow are responsible for selecting and carrying the checksum
algorithm through that workflow.
=head2 Downloads
Checksum verification is enabled by default.
lib/Amazon/S3.pm view on Meta::CPAN
my $algorithm = $s3->checksum_algorithm;
$s3->checksum_algorithm('sha256');
Gets or sets the checksum algorithm selected for uploads.
The constructor default is C<crc64nvme>.
The constructor validates the initial value. Callers that change this
accessor after construction are responsible for supplying an
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AmberDB.pm view on Meta::CPAN
Options:
=over 4
=item * C<type>: Positional selector (C<'last'>, C<'first'>, C<'rand'>). When specified, a dummy ID (e.g. C<0>) can be passed to preserve standard 3-argument positional signature consistency: C<< $adb->read_id("products", 0, { type => "last" }) >> (o...
=item * C<sort>: Optional sort block (numeric index, schema block name like C<"price">, C<"price desc">, or hashref C<< { block => "price", dir => "asc" } >>). Used in combination with C<< type => 'first' >> or C<'last'> to retrieve the first or last...
=item * C<range>: Optional numerical/chronological range filter hashref C<< { block => 4, min => 1000, max => 2000 } >> to constrain candidate records before positional selection.
=item * C<inflate>: Boolean (C<1> or string C<"inflate">) to inflate record fields into a named HASH reference based on table schema blocks.
=item * C<counter> / C<use_counter>: Explicit boolean (C<1> or C<0>) or string C<"counter"> to force or disable incrementing the read counter (C<.cnt>).
lib/AmberDB.pm view on Meta::CPAN
C<field_fetch> uses the C<match_block> definition in the schema and accesses inverted match index files (C<.fld>), providing $O(1)$ average-time lookup per indexed key (total retrieval cost scales with the number of requested values and matching reco...
=head2 search_table($table_id, $query, [\%options])
It performs searches matching query terms using the full-text C<.src> index (or a sorted table scan backup method if unindexed). C<search_table> uses the C<AmberDB::Locale> module. It features advanced language normalization according to the selected...
B<IMPORTANT (Return Signature Convention):>
When C<$limit> is passed and C<E<gt> 0> (paginated), C<search_table> returns C<($total_count, @records)> where the first scalar is the total matching count integer. When C<$limit> is omitted or C<0> (unpaginated), it returns C<@records> directly. Unp...
# 1. Unpaginated (returns array of record arrayrefs directly)
lib/AmberDB.pm view on Meta::CPAN
my @all_ids = $adb->search_table("catalog_product", "headphones", { keys_only => 1 });
my ($total_count, @ids) = $adb->search_table("catalog_product", "headphones", { offset => 0, limit => 50, keys_only => 1 });
=head2 field_filter($table_id, \%filter_options)
Performs multi-block filtered queries (AND / OR) with support for multi-value filters, tier mode selection (C<jnktype>), numerical/chronological range filtering (C<range>), sorting, and pagination:
my $res = $adb->field_filter("catalog_product", {
type => "and",
filter => { 1 => "5", 6 => ["12", "14"] },
range => { block => "price", min => 1000, max => 2500 },
view all matches for this distribution