More flexible title splitting (#1060)

These tokens should not be artist-exclusive.
This commit is contained in:
Adrian Sampson 2014-12-16 11:53:37 +00:00
parent c2c1e7236d
commit af11dedb51

View file

@ -686,9 +686,9 @@ def feat_tokens(for_artist=True):
The `for_artist` option determines whether the regex should be
suitable for matching artist fields (the default) or title fields.
"""
feat_words = ['ft', 'featuring', 'feat']
feat_words = ['ft', 'featuring', 'feat', 'feat.', 'ft.']
if for_artist:
feat_words += ['with', 'vs', 'and', 'con', '&', 'feat.', 'ft.']
feat_words += ['with', 'vs', 'and', 'con', '&']
return '(?<=\s)(?:{0})(?=\s)'.format(
'|'.join(re.escape(x) for x in feat_words)
)