ewline; set $opts->{'linesep'} to the
empty string or to a space if the result is to be sent via JSON.
If a situational version of the stemma is required, the arguments for
situation_graph should b
lysis::Result;
use Moose;
use Digest::MD5 qw/ md5_hex /;
use Encode qw/ encode_utf8 /;
use JSON qw/ to_json /;
use Set::Scalar;
use Text::Tradition::Error;
=head1 NAME
=encoding utf8
Text::Traditi
), $expected, "Got expected witness class for $wit" );
}
}
# Now write it out to JSON
my $struct = $result->TO_JSON;
my $newresult = Text::Tradition::Analysis::Result->new( $struct );
is( $result->o
oreach my $m ( $set1->members ) {
return 0 unless $all{$m};
}
return 1;
}
sub TO_JSON {
my $self = shift;
# Required values: graph and setlist
my $data = {
graph => $self->graph
asure
use Encode qw/ decode_utf8 encode_utf8 /;
use Exporter 'import';
use Graph;
use JSON qw/ to_json decode_json /;
use LWP::UserAgent;
use Set::Scalar;
use Text::Tradition::Analysis::Result;
use Te
;
my $json = JSON->new->allow_blessed->convert_blessed->utf8->encode(
[ values %problems ] );
# Send it off and get the result
# print STDERR "Sending request: " . decode_utf8( $json ) . "\n
->{solver_url}, 'Content-Type' => 'application/json',
'Content' => $json );
my $answer;
if( $resp->is_success ) {
$answer = decode_json( $resp->content );
throw( "Unexpected answ
ID. Returns any new stemmata that were created.
=begin testing
use Text::Tradition;
use JSON qw/ from_json /;
my $t = Text::Tradition->new(
'name' => 'Stemweb test',
'input' => 'Self',
mweb_jobid' => '4',
);
is( $t->stemma_count, 0, "No stemmas added yet" );
my $answer = from_json( '{"status": 0, "job_id": "4", "algorithm": "RHM", "format": "newick", "start_time": "2013-10-26