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

example.py « python « scripts - github.com/marian-nmt/marian.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c0a70720944b1c1d2f991d1064b0a7f3d4c8bc1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python

import os
import sys

sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + "../../build"))
import libmariannmt as nmt

print >>sys.stderr, "marian-nmt version: ", nmt.version()

if len(sys.argv) == 1:
    print >>sys.stderr, "Specify s2s arguments"
    exit(1)

nmt.init(' '.join(sys.argv))
for line in sys.stdin:
    print nmt.translate([line.rstrip()])