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
apiClient
TxClientThe API client to use to parse the files
parseOptions
ParseOptionsAny parsing/indexing options
rules
BatchParsingRulesThe 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.
directory
stringThe directory containing the files to be parsed
searchOption
SearchOptionsuccessCallback
Func<JobBatchSuccessResult, Task>A callback for when a file is parsed successfully
partialSuccessCallback
Func<JobBatchPartialSuccessResult, Task>A callback for when some error happened during/after parsing, but there is still usable data in the response
errorCallback
Func<BatchErrorResult, Task>A callback for when an error occurred when parsing the file, and there is no usable data
generateDocumentIdFn
Func<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
apiClient
TxClientThe API client to use to parse the files
parseOptions
ParseOptionsAny parsing/indexing options
rules
BatchParsingRulesThe 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.
directory
stringThe directory containing the files to be parsed
searchOption
SearchOptionsuccessCallback
Func<ResumeBatchSuccessResult, Task>A callback for when a file is parsed successfully
partialSuccessCallback
Func<ResumeBatchPartialSuccessResult, Task>A callback for when some error happened during/after parsing, but there is still usable data in the response
errorCallback
Func<BatchErrorResult, Task>A callback for when an error occurred when parsing the file, and there is no usable data
generateDocumentIdFn
Func<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