Пример #1
0
	def _addEdge(self, node1, node2, node1Type, node2Type, edgeType):
		if node1Type != NodeType.METHOD and node2Type != NodeType.METHOD:
			PfisGraphWithVariants._addEdge(self, node1, node2, node1Type, node2Type, edgeType)

		else:
			node1Equivalent = self._getEquivalentNode(node1, node1Type)
			node2Equivalent = self._getEquivalentNode(node2, node2Type)
			PfisGraphWithVariants._addEdge(self, node1Equivalent, node2Equivalent, node1Type, node2Type, edgeType)
Пример #2
0
 def __init__(self,
              dbFilePath,
              langHelper,
              projSrc,
              variantsDb,
              stopWords=[],
              verbose=False):
     PfisGraphWithVariants.__init__(self, dbFilePath, langHelper, projSrc,
                                    stopWords, verbose)
     self.variantsDb = variantsDb
     self.knownMethodPatches = KnownPatches(langHelper, variantsDb)
Пример #3
0
    def _addEdge(self, node1, node2, node1Type, node2Type, edgeType):
        if node1Type != NodeType.METHOD and node2Type != NodeType.METHOD:
            PfisGraphWithVariants._addEdge(self, node1, node2, node1Type,
                                           node2Type, edgeType)

        else:
            node1Equivalent = self._getEquivalentNode(node1, node1Type)
            node2Equivalent = self._getEquivalentNode(node2, node2Type)
            PfisGraphWithVariants._addEdge(self, node1Equivalent,
                                           node2Equivalent, node1Type,
                                           node2Type, edgeType)
Пример #4
0
    def getGraph(self, graphType, variantsDb):
        if graphType == None:
            graphType = "PfisGraph"

        if graphType.lower() == "PfisGraph".lower():
            return PfisGraph(self.dbPath, self.langHelper, self.projSrcPath,
                             self.stopWords)

        if graphType.lower() == "PfisGraphWithVariants".lower():
            return PfisGraphWithVariants(self.dbPath, self.langHelper,
                                         self.projSrcPath, self.stopWords)

        if graphType.lower() == "PfisGraphWithSimilarPatches".lower():
            if variantsDb is None:
                raise Exception(
                    "Missing attrib: variantsDb for graphType PfisGraphWithSimilarPatches in XML config file."
                )
            return PfisGraphWithSimilarPatches(self.dbPath, self.langHelper,
                                               self.projSrcPath, variantsDb,
                                               self.stopWords)
Пример #5
0
	def __init__(self, dbFilePath, langHelper, projSrc, variantsDb, stopWords=[], verbose=False):
		PfisGraphWithVariants.__init__(self, dbFilePath, langHelper, projSrc, stopWords, verbose)
		self.variantsDb = variantsDb
		self.knownMethodPatches = KnownPatches(langHelper, variantsDb)