diff --git a/shared/python/BGF.py b/shared/python/BGF.py index 85431172..9633e38c 100755 --- a/shared/python/BGF.py +++ b/shared/python/BGF.py @@ -12,7 +12,7 @@ def __init__(self): def parse(self,fname): self.roots = [] self.prods = [] - self.xml = ET.parse(sys.argv[1]) + self.xml = ET.parse(fname) for e in self.xml.findall('root'): self.roots.append(e.text) for e in self.xml.findall(slpsns.bgf_('production')): diff --git a/shared/python/diffShort.py b/shared/python/diffShort.py index 04831411..b562cfa2 100755 --- a/shared/python/diffShort.py +++ b/shared/python/diffShort.py @@ -2,11 +2,11 @@ import os import sys import string -import metrics +import mismatches if __name__ == "__main__": if len(sys.argv) == 4: - pnm,psm = metrics.mismatches(sys.argv[3],sys.argv[1],sys.argv[2]) + pnm,psm = mismatches.mismatches(sys.argv[3],sys.argv[1],sys.argv[2]) print 'Mismatches:',pnm,'+',psm,'=',pnm+psm else: print '''This is the shortest possible version of Grammar Diff Tool. diff --git a/shared/python/lcf2csv.py b/shared/python/lcf2csv.py index d10794bb..d63935be 100755 --- a/shared/python/lcf2csv.py +++ b/shared/python/lcf2csv.py @@ -4,7 +4,7 @@ import string import elementtree.ElementTree as ET import slpsns -import metrics +import mismatches synch = {} @@ -70,7 +70,7 @@ def measure(gdt,x,y): z=synch[y][0] else: z=synch[y][1] - nm,sm = metrics.mismatches(gdt,'bgf/'+x+'.bgf','bgf/'+z+'.bgf') + nm,sm = mismatches.mismatches(gdt,'bgf/'+x+'.bgf','bgf/'+z+'.bgf') return nm+sm,str(nm)+'\t'+str(sm)+'\t'+str(nm+sm) def cutName(lbl): diff --git a/shared/python/metrics.py b/shared/python/mismatches.py similarity index 100% rename from shared/python/metrics.py rename to shared/python/mismatches.py diff --git a/shared/python/runSliced.py b/shared/python/runSliced.py index 0f722ddd..f1e6eed7 100755 --- a/shared/python/runSliced.py +++ b/shared/python/runSliced.py @@ -5,7 +5,7 @@ import elementtree.ElementTree as ET import slpsns import slicing -import metrics +import mismatches def main(xbgfFile,bgfFile,xbgf,gdt,synch): xbgfDir = '/'.join(xbgfFile.split('/')[:-1]) @@ -16,7 +16,7 @@ def main(xbgfFile,bgfFile,xbgf,gdt,synch): print 'Slicing...' sliced = slicing.sliceFile(xbgfDir,xbgfDir,xbgfFile.split('/')[-1].replace('.xbgf','')) print 'Runnning...' - pnm,psm = metrics.mismatches(gdt,bgfFile,synch) + pnm,psm = mismatches.mismatches(gdt,bgfFile,synch) print 'Mismatches originally:',pnm,'+',psm,'...',len(sliced),'steps to go' cx = '' for p in sliced: @@ -25,7 +25,7 @@ def main(xbgfFile,bgfFile,xbgf,gdt,synch): print 'Error running',p,'!' print run sys.exit(2) - nm,sm = metrics.mismatches(gdt,bgfFile+cx+'_',synch) + nm,sm = mismatches.mismatches(gdt,bgfFile+cx+'_',synch) print 'Mismatches:',nm,'+',sm if nm>pnm: print 'Observed increase in name mismatches!' diff --git a/shared/python/xbgfSlice.py b/shared/python/xbgfSlice.py index d1c97eb6..989ef396 100755 --- a/shared/python/xbgfSlice.py +++ b/shared/python/xbgfSlice.py @@ -5,7 +5,6 @@ import elementtree.ElementTree as ET import slpsns import slicing -import metrics def main(xbgfFile): xbgfDir = '/'.join(xbgfFile.split('/')[:-1])