new script
This commit is contained in:
parent
28cf9f94a1
commit
2bc4f8b336
@ -27,25 +27,10 @@ def add_data(data):
|
||||
json.loads(urllib2.urlopen(req, json.dumps(data)).read())
|
||||
|
||||
sourceFile = sys.argv[1]
|
||||
soURCeLangId = int(sys.argv[2])
|
||||
targetLangId = int(sys.argv[3])
|
||||
name = sys.argv[4]
|
||||
tmId = int(sys.argv[2])
|
||||
|
||||
totalLines = file_len(sourceFile)
|
||||
|
||||
data = {
|
||||
'operation': 'addTm',
|
||||
'sourceLangId':sourceLangId,
|
||||
'targetLangId':targetLangId,
|
||||
'name':name
|
||||
}
|
||||
|
||||
req = urllib2.Request(address)
|
||||
req.add_header('Content-Type', 'application/json')
|
||||
response = json.loads(urllib2.urlopen(req, json.dumps(data)).read())
|
||||
tmId = int(response['newTmId'])
|
||||
print "Added new tm: %d" % tmId
|
||||
|
||||
data = {
|
||||
'operation': 'addAlignedSentences',
|
||||
'tmId':tmId
|
||||
@ -93,6 +78,3 @@ urllib2.urlopen(req, json.dumps(data)).read()
|
||||
|
||||
end = time.time()
|
||||
print "Index regeneration complete. The operation took %.4f s" % (end - start)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user