def test_re_replace_multi(self):
        r = re_add_variants(u"ae")
        self.assertEqual(r, u"([aàáâãäåāăąǎǟǡǻȁȃȧḁạảấầẩẫậắằẳẵặ]" u"[eèéêëēĕėęěȅȇȩḕḗḙḛḝẹẻẽếềểễệ]|[æǣǽ])")

        r = re_add_variants(u"SS")
        self.assertEqual(r, u"([SŚŜŞŠȘṠṢṤṦṨꞄ][SŚŜŞŠȘṠṢṤṦṨꞄ]|ẞ)")

        r = re_add_variants(u"ss")
        self.assertEqual(r, u"([sśŝşšșṡṣṥṧṩꞅ][sśŝşšșṡṣṥṧṩꞅ]|ß)")
Exemple #2
0
    def test_re_replace_multi(self):
        r = re_add_variants(u"ae")
        self.assertEqual(
            r, u"([aàáâãäåāăąǎǟǡǻȁȃȧḁạảấầẩẫậắằẳẵặ]"
            u"[eèéêëēĕėęěȅȇȩḕḗḙḛḝẹẻẽếềểễệ]|[æǣǽ])")

        r = re_add_variants(u"SS")
        self.assertEqual(r, u"([SŚŜŞŠȘṠṢṤṦṨꞄ][SŚŜŞŠȘṠṢṤṦṨꞄ]|ẞ)")

        r = re_add_variants(u"ss")
        self.assertEqual(r, u"([sśŝşšșṡṣṥṧṩꞅ][sśŝşšșṡṣṥṧṩꞅ]|ß)")
 def test_literal(self):
     self.assertEqual(re_add_variants(u"f"), u"[fḟꝼ]")
     self.assertTrue(u"ø" in re_add_variants(u"o"))
     self.assertTrue(u"Ø" in re_add_variants(u"O"))
     self.assertEqual(re_add_variants(u"[^f]"), u"[^fḟꝼ]")
 def test_seq(self):
     self.assertEqual(re_add_variants(u"[x-y]"), u"[ẋẍýÿŷȳẏẙỳỵỷỹx-y]")
     self.assertEqual(re_add_variants(u"[f-gm]"), u"[ḟꝼĝğġģǧǵḡᵹf-gmḿṁṃ]")
 def test_re_replace_escape(self):
     r = re_add_variants(u"n\\n")
     self.assertEqual(r, u"[nñńņňǹṅṇṉṋ]\n")
 def test_re_replace(self):
     r = re_add_variants(u"aa")
     self.assertTrue(u"[" in r and u"]" in r and r.count(u"ä") == 2)
Exemple #7
0
 def test_literal(self):
     self.assertEqual(re_add_variants(u"f"), u"[fḟꝼ]")
     self.assertTrue(u"ø" in re_add_variants(u"o"))
     self.assertTrue(u"Ø" in re_add_variants(u"O"))
     self.assertEqual(re_add_variants(u"[^f]"), u"[^fḟꝼ]")
Exemple #8
0
 def test_seq(self):
     self.assertEqual(re_add_variants(u"[x-y]"), u"[ẋẍýÿŷȳẏẙỳỵỷỹx-y]")
     self.assertEqual(re_add_variants(u"[f-gm]"), u"[ḟꝼĝğġģǧǵḡᵹf-gmḿṁṃ]")
Exemple #9
0
 def test_re_replace_escape(self):
     r = re_add_variants(u"n\\n")
     self.assertEqual(r, u"[nñńņňǹṅṇṉṋ]\n")
Exemple #10
0
 def test_re_replace(self):
     r = re_add_variants(u"aa")
     self.assertTrue(u"[" in r and u"]" in r and r.count(u"ä") == 2)
Exemple #11
0
 def test_re_replace_multi_nested(self):
     r = re_add_variants(u"(եւ)")
     self.assertEqual(r, u"((եւ|և))")
     r = re_add_variants(u"(եւ)+")
     self.assertEqual(r, u"((եւ|և))+")
Exemple #12
0
 def test_re_replace_multi_fixme(self):
     # we don't handler overlapping sequences, so this doesn't match "LỺ"
     r = re_add_variants(u"LLL")
     self.assertEqual(r, u"([LĹĻĽḶḸḺḼŁ][LĹĻĽḶḸḺḼŁ]|Ỻ)[LĹĻĽḶḸḺḼŁ]")
 def test_re_replace_multi_nested(self):
     r = re_add_variants(u"(եւ)")
     self.assertEqual(r, u"((եւ|և))")
     r = re_add_variants(u"(եւ)+")
     self.assertEqual(r, u"((եւ|և))+")
 def test_re_replace_multi_fixme(self):
     # we don't handler overlapping sequences, so this doesn't match "LỺ"
     r = re_add_variants(u"LLL")
     self.assertEqual(r, u"([LĹĻĽḶḸḺḼŁ][LĹĻĽḶḸḺḼŁ]|Ỻ)[LĹĻĽḶḸḺḼŁ]")