@@ -0,0 +1,998 @@
+import os%0Aimport sys%0Aimport re%0Aimport subprocess as sp%0Aimport tempfile%0Afrom django.utils import simplejson%0Afrom django.conf import settings%0A%0A%0A%0Adef isri_accuracy(gttext, text):%0A    %22%22%22%0A    Run the ISRI accuracy tool on a groundtruth%0A    and some random text.%0A    %22%22%22%0A    accuracybin = os.path.join(settings.BIN_PATH, %22accuracy%22)%0A    with tempfile.NamedTemporaryFile() as gtf:%0A        gtf.write(gttext)%0A        gtf.flush()%0A        with tempfile.NamedTemporaryFile() as f:%0A            f.write(text)%0A            f.flush()%0A            #print accuracybin, gtf.name, f.name%0A            score, err = sp.Popen(%5B%22%25s %25s %25s%22 %25 (accuracybin, gtf.name, f.name)%5D,%0A                    shell=True, stdout=sp.PIPE, stderr=sp.PIPE).communicate()%0A            pmatch = re.search('%5Cs+(?P%3Cpercent%3E%5Cd+%5C.%5Cd+)%25%5Cs+Accuracy After Correction',%0A                    score, re.MULTILINE)%0A            if pmatch:%0A                return float(pmatch.groups(%22percent%22)%5B0%5D), score%0A            return err, None    %0A                %0A%0A%0A%0A%0A

Add training/utils module. Currently just contains a function to wrap the ISRI 'accurary' utility