def Ex4(): string = "Azaz sis somarolinto go go go trenyzi12 keks koks kaks 74rus 123 321 pas123sajiri" print(StringFormatter.del_worlds(string, 5)) print(StringFormatter.replace(string)) print(StringFormatter.set_spaces(string)) print(StringFormatter.sort_size(string)) print(StringFormatter.sort(string))
def on_format_click(self, event): result = self.entry_text.Value if self.sort_checkbox.IsChecked(): if self.radio_by_size.GetValue(): result = StringFormatter.SortSize(result) else: result = StringFormatter.SortLex(result) if self.clean_checkbox.IsChecked(): result = StringFormatter.DelWords(result, int(self.size_spin.Value)) if self.replace_checkbox.IsChecked(): result = StringFormatter.ReplaceNum(result) if self.insert_spaces_checkbox.IsChecked(): result = StringFormatter.CreateSpace(result) self.result_text.Value = result
def on_format_click(self, event): result = self.entry_text.Value if self.sort_checkbox.IsChecked(): if self.radio_by_size.GetValue(): result = StringFormatter.sort_size(result) else: result = StringFormatter.sort(result) if self.clean_checkbox.IsChecked(): result = StringFormatter.del_worlds(result, int(self.size_spin.Value)) if self.replace_checkbox.IsChecked(): result = StringFormatter.replace(result) if self.insert_spaces_checkbox.IsChecked(): result = StringFormatter.set_spaces(result) self.result_text.Value = result
def get_formatted_urls(self): return StringFormatter.get_recursively_formatted_string( self.template_url, self.years)
def get_formatted_filenames(self): return StringFormatter.get_recursively_formatted_string( self.template_filename, self.years)
from StringFormatter import StringFormatter string = "tttt 5k7 kkllp;l,lp,m aaaa a p rfjri " print(StringFormatter.DelWords(string, 3)) print(StringFormatter.ReplaceNum(string)) print(StringFormatter.CreateSpace(string)) print(StringFormatter.SortSize(string)) print(StringFormatter.SortLex(string))
def formatString(self): formatter = StringFormatter(unicode(self.ui.lineEdit_2.text())) if self.ui.checkBox.isChecked(): formatter.delSmallWords(int(self.ui.spinBox.text())) if self.ui.checkBox_4.isChecked(): if self.ui.radioButton.isChecked(): formatter.sortWordsBySize() else: formatter.sortWordsLexicographically() if self.ui.checkBox_2.isChecked(): formatter.replaceDigits() if self.ui.checkBox_3.isChecked(): formatter.insertSpaces() self.ui.lineEdit.setText(formatter.getString())
def get_formatted_filenames(self): formatted_filenames = StringFormatter.get_recursively_formatted_string(self.template_filename, self.stats_url_values.keys()) return StringFormatter.get_recursively_formatted_strings(formatted_filenames, self.years)
def get_formatted_urls(self): formatted_urls = StringFormatter.get_recursively_formatted_string(self.template_url, self.stats_url_values.values()) return StringFormatter.get_recursively_formatted_strings(formatted_urls, self.years)