def process(self): compoundsList = TFSCompoundsList.getCompounds(self.log_path) # print # print 'compoundsList', compoundsList startScore, _ = self.getLatinExtendedAScore() self.initMetrics() for compoundMap in compoundsList: glyph = compoundMap['glyph'] baseGlyph = compoundMap['baseGlyph'] diacriticalMaps = compoundMap['diacriticals'] diacriticals = [] for diacriticalMap in diacriticalMaps: # print 'diacriticalMap', diacriticalMap diacritical = TFSMap() diacritical.glyph = diacriticalMap['glyph'] diacritical.align = diacriticalMap['align'] diacriticals.append(diacritical) self.createCompoundGlyph(glyph, baseGlyph, diacriticals) self.writeOutput() self.dumpMetrics() endScore, endMissing = self.getLatinExtendedAScore() print print 'startScore', startScore, 'endScore', endScore print 'endMissing', [hex(glyph) for glyph in sorted(endMissing)]
def parseAlignmentPoint(value): try: if ',' in value: left, right = value.split(',') result = TFSMap() result.x = parseAlignmentValue(left) result.y = parseAlignmentValue(right) return result else: result = TFSMap() result.x = parseAlignmentValue(value) result.y = None return result except ValueError, e: raise Exception('Invalid %s value: %s' % ( name, str(value),))