mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-01 00:12:27 +03:00
c5d39f039f
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
24 lines
853 B
Perl
Executable File
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";
|
|
}
|
|
}
|