Index: branches/weighted-transfer/apertium-weights-learner/learner.py =================================================================== --- branches/weighted-transfer/apertium-weights-learner/learner.py (nonexistent) +++ branches/weighted-transfer/apertium-weights-learner/learner.py (revision 70825) @@ -0,0 +1,204 @@ +#! /usr/bin/python3 + +import re, sys, os, pipes, math +from optparse import OptionParser, OptionGroup +from subprocess import call +import coverage +import kenlm + +# regular expression to cut out a sentence +sent_re = re.compile('.*?\$') + +weights_head = '\n\n' +weights_tail = '' + +def get_options(): + """ + Parse commandline arguments + """ + usage = "USAGE: ./%prog [