You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
510 B

from os import sys, path, listdir
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from conllu_to_xml import main as convert_one
import sys
folderin = sys.argv[1]
folderout = sys.argv[2]
for filename in sorted(list(listdir(folderin))):
if not filename.endswith('.txt'):
continue
convert_one(
"{}/{}".format(folderin, filename),
"{}/{}.xml".format(folderout, filename.split('.')[0]))
print "\r{}".format(filename),
sys.stdout.flush()