Fix exception when artist name is empty

This commit is contained in:
Benjamin Schaaf
2021-01-10 18:21:04 +11:00
parent c26238cf72
commit d47b4b6575

View File

@@ -1183,9 +1183,9 @@ class AdapterManager:
def _strip_ignored_articles(
use_ground_truth_adapter: bool, ignored_articles: Set[str], string: str
) -> str:
first_word, *rest = string.split(maxsplit=1)
if first_word in ignored_articles:
return rest[0]
parts = string.split(maxsplit=1)
if len(parts) > 1 and parts[0] in ignored_articles:
return parts[1]
return string
_S = TypeVar("_S")