#!/usr/bin/perl
#use JSON::XS;
use Clone qw(clone);
use MongoDB;
use Smart::Comments;
use lib "/home/wuyabo/shell/";
use Conn_mongo_jc;
use Data::Dumper;
use IO::File;
#use Add_info;
open(FDst,"s
$jsonxs, $msgpack, $dd_noindent, $dd_indent, $cbor
);
my $storable_tag= "strbl";
my $sereal_tag= "srl";
my %meta = (
jxs => {
enc => '$::jsonxs->encode($data);',
dec => '$::jsonx
);',
name => 'JSON::XS OO',
init => sub {
$jsonxs = JSON::XS->new()->allow_nonref();
},
use => 'use JSON::XS qw(decode_json encode_json);',
},
ddl =
. $x;
},
}
);
}
my %names = (
"JSON::XS" => 'json xs',
"Data::Dumper::Limited" => 'ddl',
"Data::MessagePack"
#!/usr/bin/perl
#use JSON::XS;
use Clone qw(clone);
use MongoDB;
use Smart::Comments;
use lib "/home/wuyabo/shell/";
use Conn_mongo_jc;
use Data::Dumper;
use IO::File;
#use Add_info;
# http://po
y
it under the same terms as Perl itself.
Except portions taken from Marc Lehmann's code for the JSON::XS
module, which is licensed under the same terms as this module.
Also except the code for Snap
rce::JSONAPI::Role::Set;
$WebAPI::DBIC::Resource::JSONAPI::Role::Set::VERSION = '0.004002';
use Moo::Role;
use Carp qw(confess);
requires '_build_content_types_provided';
requires 'encode_json';
re
quires 'set';
requires 'render_jsonapi_response';
requires 'jsonapi_type';
around '_build_content_types_provided' => sub {
my $orig = shift;
my $self = shift;
my $types = $self->$orig();
{ 'application/vnd.api+json' => 'to_json_as_jsonapi' };
return $types;
};
sub to_json_as_jsonapi {
my $self = shift;
return $self->encode_json( $self->render_jsonapi_response() );
}
1
Async::UWSGI::Server::Connection;
use Scalar::Util qw(weaken);
use URI;
use URI::QueryParam;
use JSON::MaybeXS;
use Encode qw(encode);
use Future;
use HTTP::Response;
use Protocol::UWSGI qw(:server)
!/usr/bin/perl
#词词距离计算
#输入为:
#老虎
#鲜花
#月亮
#狮子
use POSIX;
#use JSON::XS;
use Clone qw(clone);
use MongoDB;
use Smart::Comments;
use lib "/home/wyb/shell/";
#use
#!/usr/bin/perl
#use JSON::XS;
use Clone qw(clone);
use MongoDB;
use Smart::Comments;
use lib "/home/wuyabo/shell/";
use Conn_mongo_jc;
use Data::Dumper;
use IO::File;
#use Add_info;
open(FDst,"s
#ifndef SRL_COMMON_H_
#define SRL_COMMON_H_
#include "srl_inline.h"
/* inspired by JSON::XS code */
#if __GNUC__ >= 3
# define expect(expr,value) __builtin_expect((expr), (value))
#else
# define exp
v4版本基础上,合并了前4个相似中心词2个以上的类
use Algorithm::Kmeanspp;
#use JSON::XS;
use Clone qw(clone);
use MongoDB;
use Smart::Comments;
use lib "/home/wuyabo/shell/";
us
ect;
use IO::Socket::INET;
use lib "./";
use plugin_eng;
use POE qw(Component::Server::TCP);
#use JSON::XS;
use Clone qw(clone);
use Encode;
#$tt=seg_txt("我的西瓜很大");
#print $tt."222222222
#!/usr/bin/perl
#use JSON::XS;
#net结合babelnet 解析文本
use Clone qw(clone);
use MongoDB;
use Smart::Comments;
use lib "/home/wuyabo/shell/";
use Conn_mongo_jc;
use Data::Dumper;
use IO::Fi
}
else
{
$lid=0;
}
print length($res)." res---------$res------\n";
$type=join("/",@bcou);
#$type=json("/",@bcou);
open(FDb,">>zhidao_qa.txt");
print FDb "id=$lid\t$nname\t$type\t@bcou\n";
#print "$b
de_json';
requires 'item';
around '_build_content_types_provided' => sub {
my $orig = shift;
my $self = shift;
my $types = $self->$orig();
unshift @$types, { 'application/hal+json' =
> 'to_json_as_hal' };
return $types;
};
sub to_json_as_hal { return $_[0]->encode_json($_[0]->render_item_as_hal_hash($_[0]->item)) }
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
WebAPI::DBI
VERSION
version 0.004002
=head1 DESCRIPTION
Provides methods to support the C<application/hal+json> media type
for GET and HEAD requests for requests representing individual resources,
e.g. a sing
Tree::Simple;
use Socket;
use IO::Handle;
use IO::Select;
use IO::Socket::INET;
use POSIX;
#use JSON::XS;
use Smart::Comments;
use Clone qw(clone);
use POE qw(Component::Server::TCP);
use lib "/
an incoming connection to a server
=head1 VERSION
version 0.006
=head1 DESCRIPTION
=cut
use JSON::MaybeXS;
use URI::QueryParam;
use IO::Async::Timer::Countdown;
use Encode qw(encode);
use Prot
;
=head2 CONTENT_TYPE_HANDLER
=cut
our %CONTENT_TYPE_HANDLER = (
'application/javascript' => 'json',
);
use constant USE_HTTP_RESPONSE => 0;
=head1 METHODS
=cut
=head2 configure
Applies confi
ntent_handler { shift->{default_content_handler} }
=head2 json
Accessor for the current JSON state
=cut
sub json { shift->{json} ||= JSON::MaybeXS->new(utf8 => 1) }
=head2 on_read
Base read hand
bus
=item * on_request - callback when we get an incoming request
=back
=head2 json
Accessor for the current JSON state
=head2 on_read
Base read handler for incoming traffic.
Attempts to deleg
for the request body, available to the L</finish_request> callback.
=head2 content_handler_json
Handle JSON content.
=head1 INHERITED METHODS
=over 4
=item L<IO::Async::Stream>
L<close|IO::Async
Experimental support for MYMETA
if ( $ENV{X_MYMETA} ) {
if ( $ENV{X_MYMETA} eq 'JSON' ) {
$self->Meta->write_mymeta_json;
} else {
$self->Meta->write_mymeta_yaml;
}
}
return 1;
}
1;
mpFile('MYMETA.yml', $meta);
}
sub write_mymeta_json {
my $self = shift;
# We need JSON to write the MYMETA.json file
unless ( eval { require JSON; 1; } ) {
return 1;
}
# Generate the data
ta or return 1;
# Save as the MYMETA.yml file
print "Writing MYMETA.json\n";
Module::Install::_write(
'MYMETA.json',
JSON->new->pretty(1)->canonical->encode($meta),
);
}
sub _write_mymeta_da
est::EOL
Test::Version
Test::Kwalitee
MetaTests
Test::CPAN::Meta::JSON
MojibakeTests
Test::NoTabs
PodCoverageTests
PodSyntaxTests
]
[Test::EOL]
[Test::Version]
[Test::Kwalitee]
[MetaTests]
[Test::CPAN::Meta::JSON]
[Test::MinimumVersion]
max_target_perl = 5.008008
[MojibakeTests]
[Test::NoTabs