-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
* init microsoft translate * perf: microsoft translate result * optimize translate result logic * microsoft translate show parts and simpleWords. * microsoft translate result add phonetic * code 429 tips * from chinese translate, if length greater than 4 not show phonetic * miscrsoft translate token invalid, reset token. * when code205 retry once * improve the logic of wordResult * change microsoft icon --------- Co-authored-by: ChoiKarl <[email protected]>
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "Microsoft Translate.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// EZMicrosoftLookupModel.h | ||
// Easydict | ||
// | ||
// Created by ChoiKarl on 2023/8/10. | ||
// Copyright © 2023 izual. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface EZMicrosoftLookupBackTranslationsModel : NSObject | ||
@property (nonatomic, copy) NSString *normalizedText; | ||
@property (nonatomic, copy) NSString *displayText; | ||
@property (nonatomic, assign) NSInteger numExamples; | ||
@property (nonatomic, assign) NSInteger frequencyCount; | ||
@end | ||
|
||
@interface EZMicrosoftLookupTranslationsModel : NSObject | ||
@property (nonatomic, copy) NSString *normalizedTarget; | ||
@property (nonatomic, copy) NSString *displayTarget; | ||
@property (nonatomic, copy) NSString *posTag; | ||
@property (nonatomic, assign) double confidence; | ||
@property (nonatomic, copy) NSString *prefixWord; | ||
@property (nonatomic, strong) NSArray<EZMicrosoftLookupBackTranslationsModel *> *backTranslations; | ||
@end | ||
|
||
@interface EZMicrosoftLookupModel : NSObject | ||
@property (nonatomic, copy) NSString *normalizedSource; | ||
@property (nonatomic, copy) NSString *displaySource; | ||
@property (nonatomic, strong) NSArray<EZMicrosoftLookupTranslationsModel *> *translations; | ||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// EZMicrosoftLookupModel.m | ||
// Easydict | ||
// | ||
// Created by ChoiKarl on 2023/8/10. | ||
// Copyright © 2023 izual. All rights reserved. | ||
// | ||
|
||
#import "EZMicrosoftLookupModel.h" | ||
|
||
@implementation EZMicrosoftLookupBackTranslationsModel | ||
|
||
@end | ||
|
||
@implementation EZMicrosoftLookupTranslationsModel | ||
+ (NSDictionary *)mj_objectClassInArray { | ||
return @{ | ||
@"backTranslations": [EZMicrosoftLookupBackTranslationsModel class] | ||
}; | ||
} | ||
|
||
@end | ||
|
||
@implementation EZMicrosoftLookupModel | ||
+ (NSDictionary *)mj_objectClassInArray { | ||
return @{ | ||
@"translations": [EZMicrosoftLookupTranslationsModel class] | ||
}; | ||
} | ||
|
||
@end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// EZMicrosoftRequest.h | ||
// Easydict | ||
// | ||
// Created by ChoiKarl on 2023/8/8. | ||
// Copyright © 2023 izual. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
static NSString * const kTranslatorHost = @"https://www.bing.com/translator"; | ||
|
||
typedef void(^MicrosoftTranslateCompletion)(NSData * _Nullable translateData, NSData * _Nullable lookupData, NSError * _Nullable translateError, NSError * _Nullable lookupError); | ||
|
||
@interface EZMicrosoftRequest : NSObject | ||
|
||
- (void)translateWithFrom:(NSString *)from to:(NSString *)to text:(NSString *)text completionHandler:(MicrosoftTranslateCompletion)completion; | ||
|
||
- (void)reset; | ||
@end | ||
|
||
NS_ASSUME_NONNULL_END |