mosesdecoder/server/client.perl
bhaddow c5d39f039f Merge moses-server branch (includes mt moses) into trunk.
Plain (single-thread) moses should configure and build as before.
Multi-thread and server only available if appropriate options are selected
at configure/compile time.


git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@2477 1f5c12ca-751b-0410-a591-d2e778427230
2009-08-07 16:47:54 +00:00

24 lines
853 B
Perl
Executable File

#!/usr/bin/env perl
use XMLRPC::Lite;
$url = "http://localhost:9084/RPC2";
$proxy = XMLRPC::Lite->proxy($url);
#my %param = ("text" => "das ist ein haus das ist ein haus das ist ein haus");
#my %param = ("text" => "je ne sais pas . ");
#my %param = ("text" => "actes pris en application des traités ce euratom dont la publication est obligatoire");
#my %param = ("text" => "actes pris en application des " );
#my %param = ("text" => "je ne sais pas . ", "align" => "true");
my %param = ("text" => "hello !");
$result = $proxy->call("translate",\%param)->result;
print $result->{'text'} . "\n";
if ($result->{'align'}) {
print "Phrase alignments: \n";
$aligns = $result->{'align'};
foreach my $align (@$aligns) {
print $align->{'tgt-start'} . "," . $align->{'src-start'} . ","
. $align->{'src-end'} . "\n";
}
}