コード例 #1
0
    def _analyseAndCache(self, board):
        boardList = DecisionModelProxy.GetBoardList()
        if board not in boardList:
            return NullBoardAnalysis()

        boardDecisions = DecisionModelProxy.GetAllForBoardOrderedByDecisionDate(
            board)
        count = len(boardDecisions)
        early = boardDecisions[:5]
        if count >= 5:
            late = boardDecisions[count - 5:]
        else:
            late = boardDecisions

        ipcTop5 = AnalysisHelpers.IpcMainFrequencyForBoard_TopN_withPercentage(
            board, 5, count)
        articleTop5 = AnalysisHelpers.AttributeFrequencyForBoard_TopN_withPercentage(
            board, 5, count)
        citationTop5 = AnalysisHelpers.ArticleFrequencyForBoard_TopN(board, 5)

        analysis = BoardAnalysis(board, count, early, late, ipcTop5,
                                 articleTop5, citationTop5)

        self._cache[board] = analysis
        return analysis
コード例 #2
0
 def test_citationFrequency(self):
     from Decisions.DBProxy import DecisionModelProxy
     from Decisions.Analysers import AnalysisHelpers
     decisions = DecisionModelProxy.GetAllForBoard('3.1.01')
     x = AnalysisHelpers.CitationFrequency(decisions)
     y = {dec.CaseNumber: count for (dec, count) in x.items()}
     self.assertTrue(y['J 0005/80'] > 50)
コード例 #3
0
 def test_citationFrequencyForBoard(self):
     from Decisions.Analysers import AnalysisHelpers
     x = AnalysisHelpers.CitationFrequencyForBoard('3.5.01')
     y = {dec.CaseNumber: count for (dec, count) in x.items()}
     self.assertTrue(y['T 0441/92'] > 15)
コード例 #4
0
 def test_articleFrequencyForBoard(self):
     from Decisions.Analysers import AnalysisHelpers
     x = AnalysisHelpers.AttributeFrequencyForBoard('3.5.01')
     self.assertTrue(x['56'] > 1000)
コード例 #5
0
 def test_articleFrequency(self):
     from Decisions.DBProxy import DecisionModelProxy
     from Decisions.Analysers import AnalysisHelpers
     decisions = (DecisionModelProxy.GetListFromCaseNumber('T 0954/98'))
     x = AnalysisHelpers.AttributeFrequency(decisions)
     self.assertEqual(x['131'], 1)
コード例 #6
0
 def test_ipcFrequencyForBoard(self):
     from Decisions.Analysers import AnalysisHelpers
     x = AnalysisHelpers.IpcFrequencyForBoard('3.5.01')
     self.assertTrue(x['G06F 17/60'] > 150)
コード例 #7
0
 def test_ipcFrequency(self):
     from Decisions.DBProxy import DecisionModelProxy
     from Decisions.Analysers import AnalysisHelpers
     decisions = DecisionModelProxy.GetListFromCaseNumber('G 0001/97')
     x = AnalysisHelpers.IpcFrequency(decisions)
     self.assertEqual(x['G04B 37/16'], 3)