convenience scripts
This commit is contained in:
parent
1178191180
commit
0a4a9b2ce8
@ -1,8 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
CORPUS_NAME=opensubtitles
|
source corpus.cfg
|
||||||
CORPUS_PATH=../fast-aligner/corpora/$CORPUS_NAME
|
|
||||||
SRC_LANG_ID=1
|
|
||||||
TRG_LANG_ID=2
|
|
||||||
|
|
||||||
./addFastAlignedTM.py $CORPUS_NAME $CORPUS_PATH/src_clean.txt $CORPUS_PATH/src_clean.lem $SRC_LANG_ID $CORPUS_PATH/trg_clean.txt $TRG_LANG_ID $CORPUS_PATH/alignments.txt $CORPUS_PATH/ids_clean.txt
|
./add_fast_aligned_TM.py $CORPUS_NAME $CORPUS_PATH/src_clean.txt $CORPUS_PATH/src_clean.lem $SRC_LANG_ID $CORPUS_PATH/trg_clean.txt $TRG_LANG_ID $CORPUS_PATH/alignments.txt $CORPUS_PATH/ids_clean.txt
|
||||||
|
27
concordia-aligner/quick_search.py
Executable file
27
concordia-aligner/quick_search.py
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import json
|
||||||
|
import urllib2
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
|
||||||
|
data = {
|
||||||
|
'operation': 'fullSearch',
|
||||||
|
'pattern':sys.argv[1],
|
||||||
|
'tmId':int(sys.argv[2]),
|
||||||
|
'limit':10,
|
||||||
|
'offset':0
|
||||||
|
}
|
||||||
|
|
||||||
|
address = 'http://127.0.0.1:10001'
|
||||||
|
|
||||||
|
start = time.time()
|
||||||
|
req = urllib2.Request(address)
|
||||||
|
req.add_header('Content-Type', 'application/json')
|
||||||
|
response = urllib2.urlopen(req, json.dumps(data)).read()
|
||||||
|
end = time.time()
|
||||||
|
|
||||||
|
print "Execution time: %.4f seconds." % (end-start)
|
||||||
|
print "Result: "
|
||||||
|
print response
|
Loading…
Reference in New Issue
Block a user