コード例 #1
0
ファイル: RE_Rect.py プロジェクト: zhuyifei1999/guppy3
    def induce(r):
        uncommons = r.get_uncommons()
        if len(uncommons) < 2:
            return
        irs = []
        for s in rects:
            if s.dir != r.dir:
                continue
            pss = []
            uncs = s.get_uncommons(pickednos)
            lnos = s.lnos & ~pickednos
            assert len(uncs) == len(lnos)
            for unc, lno in zip(uncs, lnos):
                if unc in uncommons:
                    pss.append(lno)
            if len(pss) == len(uncommons):
                pslnos = immbitset(pss)
                pss = [lines[lno] for lno in pss]
                if s.dir == -1:
                    c = InducedRightRect
                else:
                    c = InducedLeftRect
                ir = c(s, pss, pslnos)
                irs.append(ir)

        if irs:
            news.extend(irs)
コード例 #2
0
ファイル: RE_Rect.py プロジェクト: 15580056814/hue
    def induce(r):
	if trace == 'induce':
	    pdb.set_trace()
	uncommons = r.get_uncommons()
	if len(uncommons) < 2:
	    return
	irs = []
	for s in rects:
	    if s.dir != r.dir:
		continue
	    pss = []
	    uncs = s.get_uncommons(pickednos)
	    lnos = s.lnos & ~pickednos
	    assert len(uncs) == len(lnos)
	    for unc, lno in zip(uncs, lnos):
		if unc in uncommons:
		    pss.append(lno)
	    if len(pss) == len(uncommons):
		pslnos = immbitset(pss)
		pss = [lines[lno] for lno in pss]
		if s.dir == -1:
		    c = InducedRightRect
		else:
		    c = InducedLeftRect
		ir = c(s, pss, pslnos)
		if trace == 'indap':
		    pdb.set_trace()
		irs.append(ir)
		
	if irs:
	    #pdb.set_trace()
	    news.extend(irs)
コード例 #3
0
ファイル: RE_Rect.py プロジェクト: zhuyifei1999/guppy3
 def init2(self, lnobyid, all_lines):
     self.all_lines = all_lines
     self.lnos = immbitset([lnobyid[id(line)] for line in self.lines])
     self.common_part = self.get_common_part()
コード例 #4
0
ファイル: RE_Rect.py プロジェクト: 15580056814/hue
    def init2(self, lnobyid, all_lines):
	self.all_lines = all_lines
	self.lnos = immbitset([lnobyid[id(line)] for line in self.lines])
	self.common_part = self.get_common_part()