def test_filter_non_greek(self): """ Test filter non greek characters in a mixed string. """ test_input_string = "[Ἑκα]τόμανδ[ρος Αἰσχ]ρίωνος ⋮ Ἀρ[ιστείδη..c5..]" # PH247029, line 2 comparison_string = "Ἑκατμανδρος Αἰσχρωνος Ἀριστεδη" test_result_string = filter_non_greek(test_input_string) # self.assertEqual(test_result_string, comparison_string)
def test_filter_non_greek(self): """ Test filter non greek characters in a mixed string. """ test_input_string = "[Ἑκα]τόμανδ[ρος Αἰσχ]ρίωνος ⋮ Ἀρ[ιστείδη..c5..]" # PH247029, line 2 comparison_string = "Ἑκατμανδρος Αἰσχρωνος Ἀριστεδη" test_result_string = filter_non_greek(test_input_string) # self.assertEqual(test_result_string, comparison_string)
def remove_non_greek(self, txt: str) -> str: """! \brief remove non greek characters from texts Using cltk's filter_non_greek() function. The function simply uses unicode code points to determine whether a given character is considered as greek or not. \warning this will NOT filter out sigma, omega and related characters as used by mathematical conventions. Their code points are determined to be different by unicode consortium. Make sure the text does not contain those. """ return filter_non_greek(txt)
def remove_non_greek(cls, txt: str) -> str: "" return filter_non_greek(txt)