File size: 565 Bytes
158b61b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# update the suffix-array phrasetable via XMLRPC

import xmlrpclib
import datetime

url = "http://localhost:8080/RPC2"
proxy = xmlrpclib.ServerProxy(url)

text = u"il a souhaité que la présidence trace à nice le chemin pour l' avenir ."

source = "Mein kleines Puppenhaus ."
target = "My small doll house ."
#align = "1-1 2-2 3-3 3-4 5-4"
align = "0-0 1-1 2-2 2-3 3-4"

params = {"source":source, "target":target, "alignment":align}
print "Updating with %s ..." %params

result = proxy.updater(params)
print result