Class BatchParser
- Namespace
- Textkernel.Tx.Batches
- Assembly
- Textkernel.Tx.SDK.dll
A utility to parse batches of files.
public class BatchParser
- Inheritance
-
BatchParser
- Inherited Members
Methods
ParseJobs(TxClient, ParseOptions, BatchParsingRules, string, SearchOption, Func<JobBatchSuccessResult, Task>, Func<JobBatchPartialSuccessResult, Task>, Func<BatchErrorResult, Task>, Func<string, string>)
Parses a batch of jobs
public static Task ParseJobs(TxClient apiClient, ParseOptions parseOptions, BatchParsingRules rules, string directory, SearchOption searchOption, Func<JobBatchSuccessResult, Task> successCallback, Func<JobBatchPartialSuccessResult, Task> partialSuccessCallback, Func<BatchErrorResult, Task> errorCallback, Func<string, string> generateDocumentIdFn = null)
Parameters
apiClientTxClientThe API client to use to parse the files
parseOptionsParseOptionsAny parsing/indexing options
rulesBatchParsingRulesThe rules that should be applied to whatever files are found prior to parsing. This is important to reduce the number of invalid parse API calls and reduce parsing costs.
directorystringThe directory containing the files to be parsed
searchOptionSearchOptionsuccessCallbackFunc<JobBatchSuccessResult, Task>A callback for when a file is parsed successfully
partialSuccessCallbackFunc<JobBatchPartialSuccessResult, Task>A callback for when some error happened during/after parsing, but there is still usable data in the response
errorCallbackFunc<BatchErrorResult, Task>A callback for when an error occurred when parsing the file, and there is no usable data
generateDocumentIdFnFunc<string, string>A callback so you can specify a DocumentId for each file that is parsed
Returns
Exceptions
- TxInvalidBatchException
Thrown when the directory provided does not meet the BatchParsingRules
ParseResumes(TxClient, ParseOptions, BatchParsingRules, string, SearchOption, Func<ResumeBatchSuccessResult, Task>, Func<ResumeBatchPartialSuccessResult, Task>, Func<BatchErrorResult, Task>, Func<string, string>)
Parses a batch of resumes
public static Task ParseResumes(TxClient apiClient, ParseOptions parseOptions, BatchParsingRules rules, string directory, SearchOption searchOption, Func<ResumeBatchSuccessResult, Task> successCallback, Func<ResumeBatchPartialSuccessResult, Task> partialSuccessCallback, Func<BatchErrorResult, Task> errorCallback, Func<string, string> generateDocumentIdFn = null)
Parameters
apiClientTxClientThe API client to use to parse the files
parseOptionsParseOptionsAny parsing/indexing options
rulesBatchParsingRulesThe rules that should be applied to whatever files are found prior to parsing. This is important to reduce the number of invalid parse API calls and reduce parsing costs.
directorystringThe directory containing the files to be parsed
searchOptionSearchOptionsuccessCallbackFunc<ResumeBatchSuccessResult, Task>A callback for when a file is parsed successfully
partialSuccessCallbackFunc<ResumeBatchPartialSuccessResult, Task>A callback for when some error happened during/after parsing, but there is still usable data in the response
errorCallbackFunc<BatchErrorResult, Task>A callback for when an error occurred when parsing the file, and there is no usable data
generateDocumentIdFnFunc<string, string>A callback so you can specify a DocumentId for each file that is parsed
Returns
Exceptions
- TxInvalidBatchException
Thrown when the directory provided does not meet the BatchParsingRules