Group
Show / Hide Table of Contents

Class BatchParsingRules

Rules to limit invalid parse transactions (and reduce parsing costs).

Inheritance
System.Object
BatchParsingRules
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Textkernel.Tx.Batches
Assembly: Textkernel.Tx.SDK.dll
Syntax
public class BatchParsingRules

Constructors

| Improve this Doc View Source

BatchParsingRules(Int32, IEnumerable<String>, IEnumerable<String>, Func<String, Boolean>)

Create a set of rules to limit invalid parse transactions (and reduce parsing costs).

Declaration
public BatchParsingRules(int maxBatchSize, IEnumerable<string> disallowedFileTypes = null, IEnumerable<string> allowedFileTypes = null, Func<string, bool> shouldProcessFn = null)
Parameters
Type Name Description
System.Int32 maxBatchSize

The maximum amount of files allowed in a batch parse. If a directory contains more valid files, an error is thrown. This is important to keep users from unknowingly consuming large numbers of parsing credits.

System.Collections.Generic.IEnumerable<System.String> disallowedFileTypes

File types to skip. Use the DefaultDisallowedFileTypes unless you have a specific use case.

System.Collections.Generic.IEnumerable<System.String> allowedFileTypes

File types to exclusively allow. ANY value in here will mean the DisallowedFileTypes property is ignored and only types in this list are allowed.

System.Func<System.String, System.Boolean> shouldProcessFn

A custom function to decide whether or not a file should be parsed. It should return true to parse the file. This could be used, for example, to check if you have already parsed a particular file in your system before spending credits to parse it again. NOTE: If defined, this will be called only AFTER a file passes the other 'file type' checks.

Fields

| Improve this Doc View Source

DefaultDisallowedFileTypes

The default file types that will result in invalid parse transactions (and cost unnecessary credits)

Declaration
public static ReadOnlyCollection<string> DefaultDisallowedFileTypes
Field Value
Type Description
System.Collections.ObjectModel.ReadOnlyCollection<System.String>

Properties

| Improve this Doc View Source

AllowedFileTypes

ANY value in here will mean the 'DisallowedFileTypes' property is ignored and only types in this list are allowed

Declaration
public IEnumerable<string> AllowedFileTypes { get; protected set; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.String>
| Improve this Doc View Source

DisallowedFileTypes

File types to skip.

Declaration
public IEnumerable<string> DisallowedFileTypes { get; protected set; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.String>
| Improve this Doc View Source

MaxBatchSize

The maximum amount of files allowed in a batch parse. If a directory contains more valid files, an error is thrown. This is important to keep users from unknowingly consuming large numbers of parsing credits.

Declaration
public int MaxBatchSize { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

ShouldProcessFile

A custom function to decide whether or not a file should be parsed. It should return true to parse the file.

Declaration
public Func<string, bool> ShouldProcessFile { get; protected set; }
Property Value
Type Description
System.Func<System.String, System.Boolean>
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾