-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] search CJK characters #276
Comments
I took a look within the changes made to offical iOS version in version 11.5.3 of Swiftgram. It's not a specifc CJK character searching support, but a local message searching fallback, which only happens when there is a "no result found" from Telegram server. Instead of doesn't support CJK, offical Telegram kind of like only support searching the words of Latin-like languages, it don't work for partial matching for any language that are written without words and spaces. On the other side, a program language's "local search", like // MARK: Swiftgram
var result: [Message] = []
if forceLocal {
transaction.withAllMessages(peerId: peerId, reversed: true, { message in
if result.count >= limit {
return false
}
if let tags = tags, message.tags != tags {
return true
}
if message.text.contains(query) {
result.append(message)
}
return true
})
} else {
result = transaction.searchMessages(peerId: peerId, query: query, tags: tags)
} This is a good addition even if it only support local messages. However, since full-text matching still works, when the Telegram server actually returns some message(s) from the full-text matching (when // TODO(swiftgram): Try to fallback on error when searching. RX is hard...
|> mapToSignal { result -> Signal<(SearchMessagesResult, SearchMessagesState), NoError> in
if (result.0.totalCount > 0) {
return .single(result)
}
return _internal_searchMessages(account: self.account, location: location, query: query, state: state, centerId: centerId, limit: limit, forceLocal: true)
} So, other than the local search feature itself, a "Local Search" toggle (or anything like that) is also needed to make it accessible, to make it a finished feature. Instead of only do local search when Telegram server search returns no result. (Open Swiftgram/Telegram-iOS@7d4b4ea on PC, then search |
Official Telegram doesn't support searching for CJK (Chinese, Japanese and Korean) characters. This is very inconvenient. Swiftgram has realized this function. Is it possible to implement it in Forkgram? Thanks!
The text was updated successfully, but these errors were encountered: