parent
8597b7ab49
commit
0731282ea1
@ -41,5 +41,6 @@ dependencies {
|
|||||||
implementation(libs.tinypinyin)
|
implementation(libs.tinypinyin)
|
||||||
implementation(libs.androidx.appcompat)
|
implementation(libs.androidx.appcompat)
|
||||||
implementation(libs.bundles.androidx.lifecycle)
|
implementation(libs.bundles.androidx.lifecycle)
|
||||||
|
implementation(libs.commons.text)
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package de.mm20.launcher2.ktx
|
package de.mm20.launcher2.ktx
|
||||||
|
|
||||||
import com.github.promeg.pinyinhelper.Pinyin
|
import com.github.promeg.pinyinhelper.Pinyin
|
||||||
|
import org.apache.commons.lang3.StringUtils
|
||||||
import java.net.URLDecoder
|
import java.net.URLDecoder
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
@ -13,7 +14,7 @@ fun String.decodeUrl(charset: String): String? {
|
|||||||
* TODO: Only supports Chinese/Pinyin at the moment
|
* TODO: Only supports Chinese/Pinyin at the moment
|
||||||
*/
|
*/
|
||||||
fun String.normalize(): String {
|
fun String.normalize(): String {
|
||||||
return this.romanize().lowercase(Locale.getDefault())
|
return StringUtils.stripAccents(this.romanize().lowercase(Locale.getDefault()))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user