Exemplo n.º 1
0
 def test_apply_inline_citation_regex_two_distinct_citations_different_types(
         self):
     test_input = "text [1] and text (Frood, 1942)."
     expected_output = ["[1]", "(Frood, 1942)"]
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 2
0
 def test_apply_inline_citation_regex_separate_parens_doesnt_get_roped_in(
         self):
     test_input = "(CCBT) ; NICE Technology Appraisal (2006)"
     expected_output = ["(2006)"]
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 3
0
 def test_apply_inline_citation_regex_range_in_square_brackets(self):
     test_input = "text [1-3]."
     expected_output = ["[1-3]"]
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 4
0
 def test_apply_inline_citation_regex_list_and_range_with_space_in_square_brackets(
         self):
     test_input = "text [1, 3-5]."
     expected_output = ["[1, 3-5]"]
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 5
0
 def test_apply_inline_citation_regex_single_digit_parens_no_match(self):
     test_input = "text (1)."
     expected_output = []
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 6
0
 def test_apply_inline_citation_regex_double_digit_square_brackets(self):
     test_input = "text [42]."
     expected_output = ["[42]"]
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 7
0
 def test_apply_inline_citation_regex_multi_numbers_no_match(self):
     test_input = "text (1234, 2019)."
     expected_output = []
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 8
0
 def test_apply_inline_citation_regex_lone_year_square_brackets(self):
     test_input = "text [1942]."
     expected_output = ["[1942]"]
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 9
0
 def test_apply_inline_citation_regex_lone_year_parens(self):
     test_input = "text (1942)."
     expected_output = ["(1942)"]
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 10
0
 def test_apply_inline_citation_regex_non_year_four_digit_num_parens_no_match(
         self):
     test_input = "text (1234)."
     expected_output = []
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 11
0
 def test_apply_inline_citation_regex_citation_no_parens_no_match(self):
     test_input = "text from Frood, 1942."
     expected_output = []
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 12
0
 def test_apply_inline_citation_regex_citation_two_digit_year_no_match(
         self):
     test_input = "text (Frood, 98)."
     expected_output = []
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 13
0
 def test_apply_inline_citation_two_distinct_citations(self):
     test_input = "text (Frood, 1942), (Dent, 1944)."
     expected_output = ["(Frood, 1942)", "(Dent, 1944)"]
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 14
0
 def test_apply_inline_citation_multiple_parens(self):
     test_input = "text (Frood, 1942; Dent, 1944)."
     expected_output = ["(Frood, 1942; Dent, 1944)"]
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)
Exemplo n.º 15
0
 def test_apply_inline_citation_regex_name_et_al_and_year_parens(self):
     test_input = "text (Frood et al., 1942)."
     expected_output = ["(Frood et al., 1942)"]
     self.assertEqual(ada.apply_inline_citation_regex(test_input),
                      expected_output)