Skip to content

Commit

Permalink
fix: replace symbols instead of non-alphanumeric (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyrouge committed Oct 26, 2024
1 parent 3c3244b commit 6e987bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/io/github/zyrouge/symphony/utils/Fuzzy.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ object Fuzzy {
normalizeTerms(against),
)

private val symbolsRegex = Regex("""[~${'$'}&+,:;=?@#|'"<>.^*()\[\]%!\-_/\\]+""")
private val whitespaceRegex = Regex("""\s+""")
private val alphaNumericRegex = Regex("""[^A-Za-z0-9]""")
private fun normalizeTerms(terms: String) = terms.lowercase()
.replace(symbolsRegex, "")
.replace(whitespaceRegex, " ")
.replace(alphaNumericRegex, "")
}

0 comments on commit 6e987bc

Please sign in to comment.