예제 #1
0
    def test_replace_with_dict_mufi_3(self):

        assert replace_with_dict(
            self.not_special_string, replacement_dict=chars.MUFI3,
            edge1=self.edge1, edge2=self.edge2) == self.not_special_string

        assert replace_with_dict(
            chars.MUFI3_KEYS, replacement_dict=chars.MUFI3, edge1=self.edge1,
            edge2=self.edge2) == chars.MUFI3_VALS

        assert replace_with_dict(
            "Text. &tridotdw;Alternating&AOlig;? ffi\nWith &nlrleg; "
            "special characters!&afinslig;;", replacement_dict=chars.MUFI3,
            edge1=self.edge1, edge2=self.edge2) == \
            "Text. ∵AlternatingꜴ? ffi\nWith ƞ special characters!\uefa4;"
예제 #2
0
    def test_replace_with_dict_mufi_4(self):

        assert replace_with_dict(
            self.not_special_string, replacement_dict=chars.MUFI4,
            edge1=self.edge1, edge2=self.edge2) == self.not_special_string

        assert replace_with_dict(
            chars.MUFI4_KEYS, replacement_dict=chars.MUFI4, edge1=self.edge1,
            edge2=self.edge2) == chars.MUFI4_VALS

        assert replace_with_dict(
            "Text. &llhsqb;Alternating&OBIIT;? &aeligdotbl;\nWith &circledot; "
            "special characters!­;", replacement_dict=chars.MUFI4,
            edge1=self.edge1, edge2=self.edge2) == \
            "Text. ⸤AlternatingꝊ? \ue436\nWith ◌ special characters!\xad;"
예제 #3
0
    def test_replace_with_dict_doe_sgml(self):

        assert replace_with_dict(
            self.not_special_string, replacement_dict=chars.DOE_SGML,
            edge1=self.edge1, edge2=self.edge2) == self.not_special_string

        assert replace_with_dict(
            chars.DOE_SGML_KEYS, replacement_dict=chars.DOE_SGML,
            edge1=self.edge1, edge2=self.edge2) == chars.DOE_SGML_VALS

        assert replace_with_dict(
            "Text. &omacron;Alternating&t;? &lbar;\nWith &bbar; special "
            "characters!é;", replacement_dict=chars.DOE_SGML,
            edge1=self.edge1, edge2=self.edge2) == \
            "Text. ōAlternatingþ? ł\nWith ƀ special characters!é;"
예제 #4
0
    def test_replace_with_dict_early_english_html(self):

        assert replace_with_dict(
            self.not_special_string, replacement_dict=chars.EE_HTML,
            edge1=self.edge1, edge2=self.edge2) == self.not_special_string

        assert replace_with_dict(
            chars.EE_HTML_KEYS, replacement_dict=chars.EE_HTML,
            edge1=self.edge1, edge2=self.edge2) == chars.EE_HTML_VALS

        assert replace_with_dict(
            "Text. &ae;Alternating&E;? >\nWith Ȝ special "
            "characters!ſ;", replacement_dict=chars.EE_HTML,
            edge1=self.edge1, edge2=self.edge2) == \
            "Text. æAlternatingĘ? >\nWith Ȝ special characters!ſ;"
예제 #5
0
    def test_replace_with_dict_mufi_4(self):

        assert replace_with_dict(
            self.not_special_string, replacement_dict=chars.MUFI4,
            edge1=self.edge1, edge2=self.edge2) == self.not_special_string

        assert replace_with_dict(
            chars.MUFI4_KEYS, replacement_dict=chars.MUFI4, edge1=self.edge1,
            edge2=self.edge2) == chars.MUFI4_VALS

        assert replace_with_dict(
            "Text. &llhsqb;Alternating&OBIIT;? &aeligdotbl;\nWith &circledot; "
            "special characters!­;", replacement_dict=chars.MUFI4,
            edge1=self.edge1, edge2=self.edge2) == \
            "Text. ⸤AlternatingꝊ? \ue436\nWith ◌ special characters!\xad;"
예제 #6
0
    def test_replace_with_dict_mufi_3(self):

        assert replace_with_dict(
            self.not_special_string, replacement_dict=chars.MUFI3,
            edge1=self.edge1, edge2=self.edge2) == self.not_special_string

        assert replace_with_dict(
            chars.MUFI3_KEYS, replacement_dict=chars.MUFI3, edge1=self.edge1,
            edge2=self.edge2) == chars.MUFI3_VALS

        assert replace_with_dict(
            "Text. &tridotdw;Alternating&AOlig;? ffi\nWith &nlrleg; "
            "special characters!&afinslig;;", replacement_dict=chars.MUFI3,
            edge1=self.edge1, edge2=self.edge2) == \
            "Text. ∵AlternatingꜴ? ffi\nWith ƞ special characters!\uefa4;"
예제 #7
0
    def test_replace_with_dict_early_english_html(self):

        assert replace_with_dict(
            self.not_special_string, replacement_dict=chars.EE_HTML,
            edge1=self.edge1, edge2=self.edge2) == self.not_special_string

        assert replace_with_dict(
            chars.EE_HTML_KEYS, replacement_dict=chars.EE_HTML,
            edge1=self.edge1, edge2=self.edge2) == chars.EE_HTML_VALS

        assert replace_with_dict(
            "Text. &ae;Alternating&E;? >\nWith Ȝ special "
            "characters!ſ;", replacement_dict=chars.EE_HTML,
            edge1=self.edge1, edge2=self.edge2) == \
            "Text. æAlternatingĘ? >\nWith Ȝ special characters!ſ;"
예제 #8
0
    def test_replace_with_dict_doe_sgml(self):

        assert replace_with_dict(
            self.not_special_string, replacement_dict=chars.DOE_SGML,
            edge1=self.edge1, edge2=self.edge2) == self.not_special_string

        assert replace_with_dict(
            chars.DOE_SGML_KEYS, replacement_dict=chars.DOE_SGML,
            edge1=self.edge1, edge2=self.edge2) == chars.DOE_SGML_VALS

        assert replace_with_dict(
            "Text. &omacron;Alternating&t;? &lbar;\nWith &bbar; special "
            "characters!é;", replacement_dict=chars.DOE_SGML,
            edge1=self.edge1, edge2=self.edge2) == \
            "Text. ōAlternatingþ? ł\nWith ƀ special characters!é;"
예제 #9
0
    def test_replace_with_dict_other(self):
        replacement_dict = {'a': 'z', 'e': 'q', 'i': 'w', 'o': 'p', 'u': 'x'}

        assert replace_with_dict(
            "ythklsv", replacement_dict=replacement_dict, edge1=self.edge1,
            edge2=self.edge2) == "ythklsv"

        assert replace_with_dict(
            "aeiou", replacement_dict=replacement_dict, edge1=self.edge1,
            edge2=self.edge2) == "zqwpx"

        assert replace_with_dict(
            "Jklt. aghscbmtlsro? e\nLvdy u jgdtbhn srydvlnmfk!i;",
            replacement_dict=replacement_dict, edge1=self.edge1,
            edge2=self.edge2) == "Jklt. zghscbmtlsrp? q\nLvdy x jgdtbhn " \
                                 "srydvlnmfk!w;"
예제 #10
0
    def test_replace_with_dict_other(self):
        replacement_dict = {'a': 'z', 'e': 'q', 'i': 'w', 'o': 'p', 'u': 'x'}

        assert replace_with_dict(
            "ythklsv", replacement_dict=replacement_dict, edge1=self.edge1,
            edge2=self.edge2) == "ythklsv"

        assert replace_with_dict(
            "aeiou", replacement_dict=replacement_dict, edge1=self.edge1,
            edge2=self.edge2) == "zqwpx"

        assert replace_with_dict(
            "Jklt. aghscbmtlsro? e\nLvdy u jgdtbhn srydvlnmfk!i;",
            replacement_dict=replacement_dict, edge1=self.edge1,
            edge2=self.edge2) == "Jklt. zghscbmtlsrp? q\nLvdy x jgdtbhn " \
                                 "srydvlnmfk!w;"