(self, text)
| 47 | self.character = dict_character |
| 48 | |
| 49 | def label_reverse(self, text): |
| 50 | text_re = [] |
| 51 | c_current = '' |
| 52 | for c in text: |
| 53 | if not bool(re.search('[a-zA-Z0-9 :*./%+١٢٣٤٥٦٧٨٩٠-]', c)): |
| 54 | if c_current != '': |
| 55 | text_re.append(c_current) |
| 56 | text_re.append(c) |
| 57 | c_current = '' |
| 58 | else: |
| 59 | c_current += c |
| 60 | if c_current != '': |
| 61 | text_re.append(c_current) |
| 62 | |
| 63 | return ''.join(text_re[::-1]) |
| 64 | |
| 65 | def add_special_char(self, dict_character): |
| 66 | return dict_character |