|
6 | 6 | ) |
7 | 7 |
|
8 | 8 |
|
9 | | -def test_normalize_text(): |
| 9 | +def test_normalize_text() -> None: |
10 | 10 | s = " A\u00a0test\nwith\tmulti\tspace & entities " |
11 | 11 | assert normalize_text(s) == "A test with multi space & entities" |
12 | 12 |
|
13 | 13 |
|
14 | | -def test_dehyphenate_text_newline_join(): |
| 14 | +def test_dehyphenate_text_newline_join() -> None: |
15 | 15 | # εφαρμόζο-\nνται => εφαρμόζονται |
16 | 16 | s = "Αυτό δεν εφαρμόζο-\nνται συχνά." |
17 | 17 | assert dehyphenate_text(s) == "Αυτό δεν εφαρμόζονται συχνά." |
18 | 18 |
|
19 | 19 |
|
20 | | -def test_dehyphenate_text_space_join(): |
| 20 | +def test_dehyphenate_text_space_join() -> None: |
21 | 21 | # επο- πτικών => εποπτικών |
22 | 22 | s = "στο πλαίσιο των επο- πτικών αρμοδιοτήτων" |
23 | 23 | assert dehyphenate_text(s) == "στο πλαίσιο των εποπτικών αρμοδιοτήτων" |
24 | 24 |
|
25 | 25 |
|
26 | | -def test_dehyphenate_text_preserves_real_hyphens(): |
| 26 | +def test_dehyphenate_text_preserves_real_hyphens() -> None: |
27 | 27 | # Should not touch true hyphens with uppercase names |
28 | 28 | s = "ΣΠΥΡΙΔΩΝ - ΑΔΩΝΙΣ" |
29 | 29 | assert dehyphenate_text(s) == "ΣΠΥΡΙΔΩΝ - ΑΔΩΝΙΣ" |
30 | 30 |
|
31 | 31 |
|
32 | | -def test_dehyphenate_text_restores_accent(): |
| 32 | +def test_dehyphenate_text_restores_accent() -> None: |
33 | 33 | # μεγα-\nλο => μεγάλο |
34 | 34 | s = "Αυτό είναι ένα μεγά-\nλο παράδειγμα." |
35 | 35 | assert dehyphenate_text(s) == "Αυτό είναι ένα μεγάλο παράδειγμα." |
36 | 36 |
|
37 | 37 |
|
38 | | -def test_dehyphenate_lines_basic(): |
| 38 | +def test_dehyphenate_lines_basic() -> None: |
39 | 39 | lines = ["Αυτό είναι ένα μεγά-", "λο κείμενο."] |
40 | 40 | out = dehyphenate_lines(lines) |
41 | 41 | assert out == ["Αυτό είναι ένα μεγάλο κείμενο."] |
42 | 42 |
|
43 | 43 |
|
44 | | -def test_dehyphenate_text_soft_hyphen_with_spaces(): |
| 44 | +def test_dehyphenate_text_soft_hyphen_with_spaces() -> None: |
45 | 45 | # Handle soft hyphen + spaces: "διοικη\u00AD τικό" => "διοικητικό" |
46 | 46 | s = "Το πλαίσιο είναι διοικη\u00ad τικό και σαφές." |
47 | 47 | assert dehyphenate_text(s) == "Το πλαίσιο είναι διοικητικό και σαφές." |
48 | 48 |
|
49 | 49 |
|
50 | | -def test_dehyphenate_text_idempotent(): |
| 50 | +def test_dehyphenate_text_idempotent() -> None: |
51 | 51 | s = "εφαρμόζο-\nνται επο- πτικών" |
52 | 52 | once = dehyphenate_text(s) |
53 | 53 | twice = dehyphenate_text(once) |
|
0 commit comments