diff --git a/VRE.py b/VRE.py index 73b5e9e..c23b1f7 100644 --- a/VRE.py +++ b/VRE.py @@ -278,6 +278,10 @@ class VRE: if not paper_df.empty or not dataset_df.empty or not content_df.empty or not post_df.empty: self.new_income = True + def remove_suffix(self, input_string, suffix): + if suffix and input_string.endswith(suffix): + return input_string[:-len(suffix)] + return input_string def remove_useless_dots(self, line): modline = '' @@ -339,7 +343,7 @@ class VRE: if j+1 < len(splits): splits[j] = splits[j]+'. ' if j == len(splits)-1: - splits[j] = splits[j].removesuffix('-') + splits[j] = self.remove_suffix(splits[j], '-') #splits[j].removesuffix('-') return splits, i+1 else: return [], i+1