Skip to content

Commit

Permalink
fix: do not need to check text query type when querying apple diction…
Browse files Browse the repository at this point in the history
…ary (#681)
  • Loading branch information
tisfeng authored Sep 18, 2024
1 parent 124fcbd commit 3e71979
Showing 1 changed file with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,6 @@ - (NSString *)name {
- (void)translate:(NSString *)text from:(EZLanguage)from to:(EZLanguage)to completion:(void (^)(EZQueryResult *, NSError *_Nullable))completion {
EZError *noResultError = [EZError errorWithType:EZErrorTypeNoResultsFound description:nil];

// Only query word or sentence in dictionary.
EZQueryTextType queryType = [text queryTypeWithLanguage:from maxWordCount:1];
if (queryType == EZQueryTextTypeTranslation) {
completion(self.result, noResultError);
return;
}

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// Note: this method may cost long time(>1.0s), if the html is very large.
NSString *htmlString = [self queryAllIframeHTMLResultOfWord:text
Expand Down

0 comments on commit 3e71979

Please sign in to comment.