Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/marian.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2017-08-18 23:40:06 +0300
committerRoman Grundkiewicz <rgrundki@exseed.ed.ac.uk>2017-08-18 23:40:06 +0300
commit640c3ecb24d8f872d6444c02f04b997f51e7a632 (patch)
treed2a32c5f05960b202e3b9aa59235c578ee1ca77f /scripts
parentf3958966aa9bcadaa2432a19fbae307c8a39ab9c (diff)
Unify python translate() interface with amunmt
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/server/client.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/server/client.py b/scripts/server/client.py
index d9a8ba00..fe3e2448 100755
--- a/scripts/server/client.py
+++ b/scripts/server/client.py
@@ -9,21 +9,17 @@ batchSize = int(sys.argv[1]) if len(sys.argv) > 1 else 1
def translate(batch):
ws = create_connection("ws://localhost:1234/translate")
- #batch = batch[:-1]
- print(batch)
+ #print(batch.rstrip())
ws.send(batch)
result = ws.recv()
- result = result[:-1]
- print(result)
+ print(result.rstrip())
ws.close()
- #time.sleep(5)
if __name__ == "__main__":
batchCount = 0
batch = ""
for line in sys.stdin:
- #print line
batchCount = batchCount + 1
batch += line
if batchCount == batchSize: