Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Commit

Permalink
查询单词不区分大小写(#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
tangshimin committed Jul 22, 2022
1 parent bbc0ae3 commit b754afc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/components/Search.kt
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ fun Search(

// 先搜索词库
for (word in vocabulary.wordList) {
if(word.value == input){
if(word.value.lowercase() == input.lowercase()){
searchResult = word.deepCopy()
break
}
}
// 如果词库里面没有,就搜索内置词典
if((searchResult == null) || searchResult!!.value.isEmpty()){
val dictWord = Dictionary.query(input)
val dictWord = Dictionary.query(input.lowercase())
if(dictWord != null){
searchResult = dictWord.deepCopy()
}
Expand Down

0 comments on commit b754afc

Please sign in to comment.