Esempio n. 1
0
    def test_case9_false_positive_handling(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the <italic>Fundação de Apoio, Pesquisa e Assistência</italic> (FAEPA) of the <italic>Hospital das Clínicas</italic>, Ribeirao Preto Medical School of the <italic>Universidade de São Paulo</italic> (FAEPA/HC-98/2009) and by the <italic>Programa Ensinar com Pesquisa</italic> of the <italic>Universidade de São Paulo</italic> (PROEP/2009) (grants for students in Medicine School).'
        expected = 'FAEPA/HC-98/2009'

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 2
0
    def test_case9_false_positive_handling(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the <italic>Fundação de Apoio, Pesquisa e Assistência</italic> (FAEPA) of the <italic>Hospital das Clínicas</italic>, Ribeirao Preto Medical School of the <italic>Universidade de São Paulo</italic> (FAEPA/HC-98/2009) and by the <italic>Programa Ensinar com Pesquisa</italic> of the <italic>Universidade de São Paulo</italic> (PROEP/2009) (grants for students in Medicine School).'
        expected = 'FAEPA/HC-98/2009'

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 3
0
    def test_case8(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the <italic>Fundação de Amparo à Pesquisa do Estado do Mato Grosso</italic> (FAPEMAT – Process 446298/2009) and by the <italic>Conselho Nacional de Desenvolvimento Científico e Tecnológico</italic> (CNPq – Process 471063/2009-6).'
        expected = ['446298/2009', '471063/2009-6']

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 2)
        self.assertEqual(sorted(matches), sorted(expected))

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), expected)
Esempio n. 4
0
    def test_case7(self):
        """Appears in <fn> element.
        """
        text = u'This study was partially supported by the <italic>Conselho Nacional de Desenvolvimento Científico e Tecnológico</italic> (CNPq) and by the <italic>Institutos Nacionais de Ciência e Tecnologia</italic> (INCT) <italic>de Hormônios e Saúde da Mulher</italic> (CNPq/INCT 573747/2008-3).'
        expected = '573747/2008-3'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 5
0
    def test_case6(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the Fundação de Amparo à Pesquisa do Estado de São Paulo (FAPESP – Process 2009/08844-8).'
        expected = '2009/08844-8'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 6
0
    def test_case5(self):
        """Appears in <fn> element.
        """
        text = u'The author received a grant from the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (Capes) during the doctorate and from the Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq) during the Sandwich PhD abroad (SWE – Process 200741/2011-0).'
        expected = '200741/2011-0'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 7
0
    def test_case6(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the Fundação de Amparo à Pesquisa do Estado de São Paulo (FAPESP – Process 2009/08844-8).'
        expected = '2009/08844-8'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 8
0
    def test_case3(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the <italic>Fundação para o Desenvolvimento Científico e Tecnológico em Saúde</italic> (FIOTEC – Process ENSP-013-LIV10-2-5-33 –<italic> Programa Inova </italic>ENSP).'
        expected = 'ENSP-013-LIV10-2-5-33'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 9
0
    def test_case1(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq – Process 302.600/2008-6 – Productivity grant).'
        expected = '302.600/2008-6'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 10
0
    def test_case1(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq – Process 302.600/2008-6 – Productivity grant).'
        expected = '302.600/2008-6'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 11
0
    def test_case12(self):
        """Appears in <ack> element.
        """
        text = u'Research supported by FAPESP (#2000/08755-0), CNPq (#301483/2006-0) and FUNDECT (#0248/12).'
        expected = ['#2000/08755-0', '#301483/2006-0', '#0248/12']

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 3)
        self.assertEqual(sorted(matches), sorted(expected))

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), expected)
Esempio n. 12
0
    def test_case10(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the <italic>Fundação de Amparo à Pesquisa do Estado de Minas Gerais </italic>and the<italic> Universidade Estadual de Montes Claros</italic> (FAPEMIG/UNIMONTES – <italic>Programa de Capacitação de Recursos Humanos</italic> – Process 90508-11 – Doctoral grant to Sibylle Emilie Vogt).'
        expected = '90508-11'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 13
0
    def test_case8(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the <italic>Fundação de Amparo à Pesquisa do Estado do Mato Grosso</italic> (FAPEMAT – Process 446298/2009) and by the <italic>Conselho Nacional de Desenvolvimento Científico e Tecnológico</italic> (CNPq – Process 471063/2009-6).'
        expected = ['446298/2009', '471063/2009-6']

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 2)
        self.assertEqual(sorted(matches), sorted(expected))

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), expected)
Esempio n. 14
0
    def test_case7(self):
        """Appears in <fn> element.
        """
        text = u'This study was partially supported by the <italic>Conselho Nacional de Desenvolvimento Científico e Tecnológico</italic> (CNPq) and by the <italic>Institutos Nacionais de Ciência e Tecnologia</italic> (INCT) <italic>de Hormônios e Saúde da Mulher</italic> (CNPq/INCT 573747/2008-3).'
        expected = '573747/2008-3'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 15
0
    def test_case2(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the Brazilian Ministry of Health/Secretariat of Health Surveillance/Department of STD, AIDS and Viral Hepatitis, through the Project of International Technical Cooperation AD/BRA/03/H34 between the Brazilian Government and the United Nations Office on Drugs and Crime (Process CSV 234/07).'
        expected = '234/07'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 16
0
    def test_case10(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the <italic>Fundação de Amparo à Pesquisa do Estado de Minas Gerais </italic>and the<italic> Universidade Estadual de Montes Claros</italic> (FAPEMIG/UNIMONTES – <italic>Programa de Capacitação de Recursos Humanos</italic> – Process 90508-11 – Doctoral grant to Sibylle Emilie Vogt).'
        expected = '90508-11'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 17
0
    def test_case3(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the <italic>Fundação para o Desenvolvimento Científico e Tecnológico em Saúde</italic> (FIOTEC – Process ENSP-013-LIV10-2-5-33 –<italic> Programa Inova </italic>ENSP).'
        expected = 'ENSP-013-LIV10-2-5-33'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 18
0
    def test_case2(self):
        """Appears in <fn> element.
        """
        text = u'This study was supported by the Brazilian Ministry of Health/Secretariat of Health Surveillance/Department of STD, AIDS and Viral Hepatitis, through the Project of International Technical Cooperation AD/BRA/03/H34 between the Brazilian Government and the United Nations Office on Drugs and Crime (Process CSV 234/07).'
        expected = '234/07'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 19
0
    def test_case5(self):
        """Appears in <fn> element.
        """
        text = u'The author received a grant from the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior (Capes) during the doctorate and from the Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq) during the Sandwich PhD abroad (SWE – Process 200741/2011-0).'
        expected = '200741/2011-0'

        matches = self.pattern.findall(text)
        self.assertEqual(len(matches), 1)
        self.assertEqual(matches[0], expected)

        # Trying to eliminate false positives.
        self.assertEqual(checks._find_contract_numbers(text), [expected])
Esempio n. 20
0
    def test_case4(self):
        """Appears in <fn> element.
        """
        text = u'Estudo financiado pelo Projeto de Pesquisa Ministério de Ciência e Tecnologia (MCT), Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq – Edital MCT-CNPq/CT – Saúde 021/2008 – Processo 402195/2008).'
        expected = '402195/2008'

        matches = self.pattern.findall(text)
        # Impossible to disambiguate the edital number and the process number.
        # In that cases, the reviewer must be warned and perform a manual
        # validation.
        self.assertEqual(len(matches), 2)
        self.assertIn(expected, matches)
        self.assertIn('021/2008', matches)  # edital number

        # Trying to eliminate false positives.
        self.assertEqual(sorted(checks._find_contract_numbers(text)),
                         sorted([expected, '021/2008']))
Esempio n. 21
0
    def test_case4(self):
        """Appears in <fn> element.
        """
        text = u'Estudo financiado pelo Projeto de Pesquisa Ministério de Ciência e Tecnologia (MCT), Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq – Edital MCT-CNPq/CT – Saúde 021/2008 – Processo 402195/2008).'
        expected = '402195/2008'

        matches = self.pattern.findall(text)
        # Impossible to disambiguate the edital number and the process number.
        # In that cases, the reviewer must be warned and perform a manual
        # validation.
        self.assertEqual(len(matches), 2)
        self.assertIn(expected, matches)
        self.assertIn('021/2008', matches)  # edital number

        # Trying to eliminate false positives.
        self.assertEqual(sorted(checks._find_contract_numbers(text)),
                         sorted([expected, '021/2008']))