diff options
author | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2014-07-09 05:41:28 +0400 |
---|---|---|
committer | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2014-07-09 05:41:28 +0400 |
commit | 4d41211c2cd6eb75c5a229c10e98fdfa1acff3b4 (patch) | |
tree | 142dca24625b301147a931f728825dd40cf74e53 /scripts/server/moses.py | |
parent | 28d64e23396cba53a83b75e01e9977db636e2285 (diff) |
Major overhaul of Mmsapt. Reorganization of old and addition of new features in phrase tables. Many critical bug fixes.
Diffstat (limited to 'scripts/server/moses.py')
-rw-r--r-- | scripts/server/moses.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/server/moses.py b/scripts/server/moses.py index 155458b9b..a176c473a 100644 --- a/scripts/server/moses.py +++ b/scripts/server/moses.py @@ -152,7 +152,7 @@ def find_free_port(p): class MosesServer(ProcessWrapper): - def __init__(self,args=["-fd", "\n"]): + def __init__(self,args=[]): self.process = None mserver_cmd = moses_root+"/bin/mosesserver" self.cmd = [mserver_cmd] + args @@ -175,7 +175,10 @@ class MosesServer(ProcessWrapper): self.cmd.extend(["--server-port", "%d"%self.port]) if debug: print >>sys.stderr,self.cmd - self.process = Popen(self.cmd,stderr = sys.stderr) + # self.stderr = open("mserver.%d.stderr"%self.port,'w') + # self.stdout = open("mserver.%d.stdout"%self.port,'w') + # self.process = Popen(self.cmd,stderr = self.stderr,stdout = self.stdout) + self.process = Popen(self.cmd) else: devnull = open(os.devnull,"w") self.process = Popen(self.cmd, stderr=devnull, stdout=devnull) @@ -216,10 +219,13 @@ class MosesServer(ProcessWrapper): elif type(input) is list: return [self.translate(x) for x in input] + elif type(input) is dict: return self.proxy.translate(input) + else: raise Exception("Can't handle input of this type!") + except: attempts += 1 print >>sys.stderr, "WAITING", attempts |