Remove more common prefixes

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2019-05-15 20:00:59 +02:00
parent 16085843c8
commit e1cfff3216
No known key found for this signature in database
GPG key ID: 695714BD1BBC5F4C

View file

@ -139,6 +139,7 @@ class Metadata:
self._description = self._summary = None
return
description = description.replace('\n\n', '\r').replace('\n', ' ').replace('\r', '\n').strip()
description = re.sub(rf'^(?:{self.name}|This(?:\s+\w+)?)(?:\s*,|\s+is|\s+provides)\s+', '', description, flags=re.I)
description = re.sub(r'^(?:a|an|the)\s+', '', description, flags=re.I)
description = f'{description[0].upper()}{description[1:]}'
if description[-1] != '.':