斯潘8
斯潘4
嗨,大家好,
我有一个2.7(我们以前的默认值)的脚本,现在已经切换到3.6以保持最新。
我在第18行收到一个语法错误,但我不明白为什么,很明显我错过了…
另外,对脚本的任何反馈都很酷,我对巨蟒还是个新手,所以会很感激的!
提前谢谢
#导入我们可能需要的库import difflibimport fmeimport fmeobjects创建要执行的类,根据FME规范:https://docs.safe.com/fme/亚搏在线html/fme_desktop_documentation/fme_transformers/transformers/pythoncaller.htmclass addressmatch(object):def_u init_uuu(self):self.datad=[]self.pread='self.outputindex=0 self.tmp=0 self.matchrate=0 def input(self,feature):if self.pread<>feature.getattribute('current_address')和self.pread<>枚举中的项(self.datad):self.tmp=difflib.sequencematcher(none,item.getattribute('current_address'),item.getattribute('full_address')。如果self.tmp>self.matchRate:self.matchRate=self.tmp self.outputindex=index,如果self.tmp>=0.95:break self.datad[self.outputindex].setattribute(“matchrating”,self.matchRate)self.pyoutput(self.datad[self.outputindex])self.datad=[]self.datad.append(feature)self.pread=feature.getattribute(“current_address”)def close(self):self.outputindex=0 se对于idx,lf.tmp=0 self.matchrate=0,枚举中的项(self.datad):self.tmp=difflib.sequencematcher(none,item.getattribute('current_address'),item.getattribute('full_address').quick_ratio()if self.tmp>self.matchRate:self.matchRate=self.tmp self.outputindex=idx if self.tmp>=0.95:break self.datad[self.outputindex].setattribute(“matchRating”,self.matchRate)self.pyoutput(self.datad[self.outputindex])
?2019安全亚搏在线软件公司|合法的