def SaveTValues(self, tFile): outputLines = [] for key, val in self.__tMap.items(): outputLines.append("%s %s %s" % (key.f, key.eCondition, val)) outputText = '\n'.join(outputLines) u.saveToFile(tFile, outputText)
def SaveTValues(self, tFile): outputLines = [] for key, val in self.__tMap.items(): outputLines.append("%s %s %s" % ( key.f, key.eCondition, val) ) outputText = '\n'.join(outputLines) u.saveToFile(tFile, outputText)
def SaveQValues(self, qFile): outputLines = [] for key, val in self.__qMap.items(): outputLines.append("%s %s %s %s %s" % ( key.j, key.iCondition, key.lCondition, key.mCondition, val) ) outputText = '\n'.join(outputLines) u.saveToFile(qFile, outputText)
def SaveQValues(self, qFile): outputLines = [] for key, val in self.__qMap.items(): outputLines.append( "%s %s %s %s %s" % (key.j, key.iCondition, key.lCondition, key.mCondition, val)) outputText = '\n'.join(outputLines) u.saveToFile(qFile, outputText)
def SaveAlignments(alignmentFile, alignments): # SentenceIndex, EnglishIndex, ForeignIndex outputLines = [] for alignment in alignments: outputLines.append("%s %s %s" % ( alignment.SentenceIndex, alignment.TargetIndex, alignment.SourceIndex )) outputText = '\n'.join(outputLines) u.saveToFile(alignmentFile, outputText)
def SaveAlignments(alignmentFile, alignments): # SentenceIndex, EnglishIndex, ForeignIndex outputLines = [] for alignment in alignments: outputLines.append("%s %s %s" % (alignment.SentenceIndex, alignment.TargetIndex, alignment.SourceIndex)) outputText = '\n'.join(outputLines) u.saveToFile(alignmentFile, outputText)
def Save(self, qFile): outputLines = [] for key1, qList in self.__qMap.items(): for key2, val in qList.items(): lk = key1[0] mk = key1[1] j = key2[0] i = key2[1] outputLines.append("%s %s %s %s %s" % ( j, i, lk, mk, val)) outputText = '\n'.join(outputLines) u.saveToFile(qFile, outputText)