Commit d8ec70dc authored by rabauti's avatar rabauti
Browse files

kataloogide loogika targemaks, lobiseb ka vähem

parent 78eae287
#/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import getopt
import re
import subprocess
script_name = (os.path.realpath(__file__))
script_dir = os.path.dirname(script_name)
#lähtefail
infile = '/Users/rabauti/repos/tu/ut_veakorpus/korpus_tsv/korpus.tsv'
sh_script = '/Users/rabauti/repos/tu/ut_veakorpus/korpus_sh/sh/sh.sh'
outfile = '/Users/rabauti/repos/tu/ut_veakorpus/korpus_sh/korpus.a'
###############################
......@@ -57,7 +56,7 @@ def getOptions():
options = getOptions()
if not "tsv_file" in options or not len(options['tsv_file']):
options['tsv_file'] = '../korpus_tsv/korpus.tsv'
options['tsv_file'] = re.sub(r'[^\ /]*$','', script_dir)+ '/korpus_tsv/korpus.tsv'
if not "result_file" in options or not len(options['result_file']):
......@@ -85,7 +84,7 @@ for row in tsv_file.read().split('\n'):
arr = row.split('\t')
if len(arr)>1:
if len(arr[0]) and len(arr[1]):
print ([options['sh_script'], '%s'%arr[0] , '%s'%arr[1]] )
#print ([options['sh_script'], '%s'%arr[0] , '%s'%arr[1]] )
subprocess.run([options['sh_script'], '%s'%arr[0] , '%s'%arr[1]], stdout=outfile)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment