Do not substitute game name delimiters separated by fewer than two letters to allow titles like "R.O.V.E.R.".
This commit is contained in:
parent
df4cafadbd
commit
42b8b65de9
|
@ -102,8 +102,9 @@ class DailyReleasesBot(object):
|
||||||
"|iNTERNAL|Steam[._-]?Edition)",
|
"|iNTERNAL|Steam[._-]?Edition)",
|
||||||
rls_name, flags=re.IGNORECASE)
|
rls_name, flags=re.IGNORECASE)
|
||||||
|
|
||||||
# Prettify game name by substituting word delimiters with spaces and capitalizing each word
|
# Prettify game name by substituting word delimiters with spaces and capitalizing each word. Delimiters
|
||||||
game_name = string.capwords(re.sub("[._-]", " ", game_name))
|
# separated by fewer than two letters are not substituted, to allow titles like "R.O.V.E.R."
|
||||||
|
game_name = string.capwords(re.sub("[._-]([a-zA-Z]{2,}|[0-9]+)", " \g<1>", game_name))
|
||||||
|
|
||||||
# Some stopwords are interesting enough to add next to the game in parentheses - we call these tags
|
# Some stopwords are interesting enough to add next to the game in parentheses - we call these tags
|
||||||
tags = [stopword
|
tags = [stopword
|
||||||
|
|
Reference in a new issue