diff --git a/src/main/kotlin/fr/shikkanime/utils/StringUtils.kt b/src/main/kotlin/fr/shikkanime/utils/StringUtils.kt index 907de8ce..e383fda6 100644 --- a/src/main/kotlin/fr/shikkanime/utils/StringUtils.kt +++ b/src/main/kotlin/fr/shikkanime/utils/StringUtils.kt @@ -18,7 +18,7 @@ object StringUtils { private val nonLatinPattern: Pattern = Pattern.compile("[^\\w-]") private val whitespacePattern: Pattern = Pattern.compile("\\s|:\\b|\\.\\b|/\\b|&\\b") private val regex = "( [-|!].*[-|!])|( Saison \\d*)|\\(\\d*\\)".toRegex() - private val separators = listOf(":", ",", "!", "–", " so ") + private val separators = listOf(":", ",", "!", "–", " so ", " - ") private fun isAllPartsHaveSameAmountOfWords(parts: List, limit: Int): Boolean { val words = parts.map { it.trim().split(" ").size } diff --git a/src/test/kotlin/fr/shikkanime/utils/StringUtilsTest.kt b/src/test/kotlin/fr/shikkanime/utils/StringUtilsTest.kt index 24cf3d12..7d80e1ea 100644 --- a/src/test/kotlin/fr/shikkanime/utils/StringUtilsTest.kt +++ b/src/test/kotlin/fr/shikkanime/utils/StringUtilsTest.kt @@ -42,6 +42,8 @@ class StringUtilsTest { "Rent-a-Girlfriend" to "Rent-a-Girlfriend", "After-school Hanako-kun" to "After-school Hanako-kun", "Kaguya-sama: Love Is War" to "Kaguya-sama", + "DanMachi - La Légende des Familias" to "DanMachi", + "Demon Slayer - Le village des forgerons" to "Demon Slayer", ) list.forEach { (input, expected) -> @@ -69,6 +71,8 @@ class StringUtilsTest { "The Strongest Tank's Labyrinth Raids -A Tank with a Rare 9999 Resistance Skill Got Kicked from the Hero's Party-" to "the-strongest-tanks-labyrinth-raids", "'Tis Time for \"Torture,\" Princess" to "tis-time-for-torture-princess", "X&Y" to "x-y", + "DanMachi - La Légende des Familias" to "danmachi", + "Demon Slayer - Le village des forgerons" to "demon-slayer", ) list.forEach { (input, expected) ->