@@ -1592,7 +1592,9 @@ def remove_nonprintable(self, replace_with: Union[str, bytes] = b"") -> DataForm
15921592 return self
15931593
15941594 @ChepyDecorators .call_stack
1595- def swap_endianness (self , word_length : int = 4 , pad_incomplete : bool = True ) -> DataFormatT :
1595+ def swap_endianness (
1596+ self , word_length : int = 4 , pad_incomplete : bool = True
1597+ ) -> DataFormatT :
15961598 """Swap endianness.
15971599
15981600 Args:
@@ -1614,7 +1616,7 @@ def swap_endianness(self, word_length: int = 4, pad_incomplete: bool=True) -> Da
16141616 swapped_data += struct .pack ("B" * word_length , * swapped_word )
16151617
16161618 if not pad_incomplete :
1617- swapped_data = swapped_data .replace (b' \x00 ' , b'' )
1619+ swapped_data = swapped_data .replace (b" \x00 " , b"" )
16181620 self .state = swapped_data
16191621 return self
16201622
@@ -2389,3 +2391,31 @@ def parse_sqlite(self, query: str) -> DataFormatT:
23892391
23902392 self .state = hold
23912393 return self
2394+
2395+ @ChepyDecorators .call_stack
2396+ def to_italics (self ) -> DataFormatT :
2397+ """Convert string alphabets to italics
2398+
2399+ Returns:
2400+ Chepy: The Chepy object.
2401+ """
2402+ text = self ._convert_to_str ()
2403+ normal = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
2404+ italic = "๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ ๐ก"
2405+ translation_table = str .maketrans (normal , italic )
2406+ self .state = text .translate (translation_table )
2407+ return self
2408+
2409+ @ChepyDecorators .call_stack
2410+ def from_italics (self ) -> DataFormatT :
2411+ """Convert italic string alphabets to ascii
2412+
2413+ Returns:
2414+ Chepy: The Chepy object.
2415+ """
2416+ text = self ._convert_to_str ()
2417+ normal = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
2418+ italic = "๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ ๐ก"
2419+ translation_table = str .maketrans (italic , normal )
2420+ self .state = text .translate (translation_table )
2421+ return self
0 commit comments