sensitivity.io for iOS & macOS  1.1.4
Instance Methods | List of all members
ClassifierExecutor Class Reference

#import <ClassifierExecutor.h>

Inheritance diagram for ClassifierExecutor:

Instance Methods

(instancetype _Nullable) - initWithError:
 
(ThreadPool *_Nullable) - threadPoolWithError:
 
(ClassificationFuture *_Nullable) - classifyString:withPriotiry:withError:
 
(ClassificationFuture *_Nullable) - classifyData:fileName:withPriotiry:withError:
 
(ClassificationFuture *_Nullable) - classifyFileAtPath:withPriotiry:withError:
 

Detailed Description

ClassifierExecutor class provides the means to classify multiple texts, data and files simultaneously. Before performing any classify action the classification module needs to have its resources initialized, the license needs to be loaded, the classifier executor needs to be registered with a settings loader and the settings need to be loaded.

Method Documentation

◆ classifyData:fileName:withPriotiry:withError:()

- (ClassificationFuture* _Nullable) classifyData: (NSData *_Nonnull)  data
fileName: (NSString *_Nullable)  fileName
withPriotiry: (NSInteger)  priority
withError: (NSError *_Nullable *_Nullable)  error 

Classifies data.

Remarks
Relevant errors: SENSITIVITYIO_ELICENSEEXPIRED, SENSITIVITYIO_EINVALIDLICENSE, SENSITIVITYIO_ESETTINGS, SENSITIVITYIO_EUNSUPPORTEDMIMETYPE, EIO
Parameters
dataThe data that needs to be classified
fileNameIf data is the content of a file, pass file name (otherwise it may be nil or empty string)
priorityThe priority of this classify. High priority classify execute before low priority ones.
errorThe error representing the reason for the failure
Returns
The threat infos future which allows you to monitor this classify's status and threat results or nil in case an error occured

◆ classifyFileAtPath:withPriotiry:withError:()

- (ClassificationFuture* _Nullable) classifyFileAtPath: (NSString *_Nonnull)  filePath
withPriotiry: (NSInteger)  priority
withError: (NSError *_Nullable *_Nullable)  error 

Classifies file.

Remarks
Relevant errors: SENSITIVITYIO_ELICENSEEXPIRED, SENSITIVITYIO_EINVALIDLICENSE, SENSITIVITYIO_ESETTINGS, SENSITIVITYIO_EUNSUPPORTEDMIMETYPE, ENOENT, EIO
Parameters
filePathThe path of the file that needs to be classified
priorityThe priority of this classify. High priority classify execute before low priority ones.
errorThe error representing the reason for the failure
Returns
The threat infos future which allows you to monitor this classify's status and threat results or nil in case an error occured

◆ classifyString:withPriotiry:withError:()

- (ClassificationFuture* _Nullable) classifyString: (NSString *_Nonnull)  text
withPriotiry: (NSInteger)  priority
withError: (NSError *_Nullable *_Nullable)  error 

Classifies provided text.

Remarks
Relevant errors: SENSITIVITYIO_ELICENSEEXPIRED, SENSITIVITYIO_EINVALIDLICENSE, SENSITIVITYIO_ESETTINGS, EIO
Parameters
textThe text to classify
priorityThe priority of this classify. High priority classify execute before low priority ones.
errorThe error representing the reason for the failure
Returns
The threat infos future which allows you to monitor this classify's status and threat results or nil in case an error occured

◆ initWithError:()

- (instancetype _Nullable) initWithError: (NSError *_Nullable *_Nullable)  error

Initializes a new object immediately after memory for it has been allocated

Note
The designated initializer
Parameters
errorThe error representing the reason for the failure
Returns
The initialized object

◆ threadPoolWithError:()

- (ThreadPool* _Nullable) threadPoolWithError: (NSError *_Nullable *_Nullable)  error

Returns the thread pool of the classifier executor

Attention
A classifier executor is responsible for creating it's thread pool and for relinquishing ownership of it when the classifier executor itself is released.
Parameters
errorThe error representing the reason for the failure
Returns
The thread pool of the classifier executor or nil in case an error occured

The documentation for this class was generated from the following file: