![]() |
sensitivity.io for iOS & macOS
1.1.4
|
#import <Classifier.h>
Instance Methods | |
(instancetype _Nullable) | - initWithError: |
(BOOL) | - cancelClassifyWithError: |
(BOOL) | - isCanceled:withError: |
(Classification *_Nullable) | - classifyString:withError: |
(Classification *_Nullable) | - classifyData:fileName:withError: |
(Classification *_Nullable) | - classifyFileAtPath:withError: |
Classifier class provides the means to classify texts, data and files. Before performing any classify action the classification module needs to have its resources initialized, the license needs to be loaded, the classifier needs to be registered with a settings loader and the classifier settings need to be loaded with that settings loader. When cancelling a classifier, it will become invalid, so in order to perform a new classify you need to create a new instance of Classifier.
- (BOOL) cancelClassifyWithError: | (NSError *_Nullable *_Nullable) | error |
Cancels current classify
error | The error representing the reason for the failure |
- (Classification* _Nullable) classifyData: | (NSData *_Nonnull) | data | |
fileName: | (NSString *_Nullable) | fileName | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Classifies data.
data | The data that needs to be classified |
fileName | If data is the content of a file, pass file name (otherwise it may be nil or empty string) |
error | The error representing the reason for the failure |
- (Classification* _Nullable) classifyFileAtPath: | (NSString *_Nonnull) | filePath | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Classifies file.
filePath | The path of the file that needs to be classified |
error | The error representing the reason for the failure |
- (Classification* _Nullable) classifyString: | (NSString *_Nonnull) | text | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Classifies provided text.
text | The text to classify |
error | The error representing the reason for the failure |
- (instancetype _Nullable) initWithError: | (NSError *_Nullable *_Nullable) | error |
Initializes a new object immediately after memory for it has been allocated
error | The error representing the reason for the failure |
- (BOOL) isCanceled: | (BOOL *_Nonnull) | canceled | |
withError: | (NSError *_Nullable *_Nullable) | error | |
Checks if classifier is canceled
canceled | Will be set to the canceled status in case the check was successful |
error | The error representing the reason for the failure |