RecognizeContentOptions Class

  • java.lang.Object
    • com.azure.ai.formrecognizer.models.RecognizeContentOptions

public final class RecognizeContentOptions

Options that may be passed when using recognize content APIs on Form Recognizer client.

Constructor Summary

Constructor Description
RecognizeContentOptions()

Create a RecognizeContentOptions object.

Method Summary

Modifier and Type Method and Description
FormContentType getContentType()

Get the type of the form.

FormRecognizerLanguage getLanguage()

Get the BCP-47 language code of the text in the document.

List<String> getPages()

Get the custom page numbers for multi-page documents(PDF/TIFF).

Duration getPollInterval()

Get the duration between each poll for the operation status.

FormReadingOrder getReadingOrder()

Get the order in which recognized text lines are returned.

RecognizeContentOptions setContentType(FormContentType contentType)

Set the type of the form.

RecognizeContentOptions setLanguage(FormRecognizerLanguage language)

Set the BCP-47 language code of the text in the document.

RecognizeContentOptions setPages(List<String> pages)

Set the custom page numbers for multi-page documents(PDF/TIFF).

RecognizeContentOptions setPollInterval(Duration pollInterval)

Set the duration between each poll for the operation status.

RecognizeContentOptions setReadingOrder(FormReadingOrder readingOrder)

Specifies the order in which recognized text lines are returned.

Methods inherited from java.lang.Object

Constructor Details

RecognizeContentOptions

public RecognizeContentOptions()

Create a RecognizeContentOptions object.

Method Details

getContentType

public FormContentType getContentType()

Get the type of the form. Supported Media types including .pdf, .jpg, .png or .tiff type file stream.

Returns:

the contentType value.

getLanguage

public FormRecognizerLanguage getLanguage()

Get the BCP-47 language code of the text in the document. See supported language codes here.

Returns:

the language code for the text in the document.

getPages

public List getPages()

Get the custom page numbers for multi-page documents(PDF/TIFF). Input the number of the pages you want to get the recognized result for.

For a range of pages, use a hyphen, ex - ["1-3"]. Separate each page or a page range with a comma, ex - ["1-3", 4].

Returns:

the list of custom page numbers for a multi page document.

getPollInterval

public Duration getPollInterval()

Get the duration between each poll for the operation status. If none is specified, a default of 5 seconds is used.

Returns:

the pollInterval value.

getReadingOrder

public FormReadingOrder getReadingOrder()

Get the order in which recognized text lines are returned.

Returns:

the order in which the recognized lines are returned.

setContentType

public RecognizeContentOptions setContentType(FormContentType contentType)

Set the type of the form. Supported Media types including .pdf, .jpg, .png or .tiff type file stream.

Parameters:

contentType - the provided form content type.

Returns:

the updated RecognizeContentOptions value.

setLanguage

public RecognizeContentOptions setLanguage(FormRecognizerLanguage language)

Set the BCP-47 language code of the text in the document. See supported language codes here.

Parameters:

language - the language code value to set.

Returns:

the updated RecognizeContentOptions value.

setPages

public RecognizeContentOptions setPages(List pages)

Set the custom page numbers for multi-page documents(PDF/TIFF). Input the number of the pages you want to get the recognized result for.

For a range of pages, use a hyphen, ex - ["1-3"]. Separate each page or a page range with a comma, ex - ["1-3", 4].

Parameters:

pages - the custom page numbers value to set.

Returns:

the updated RecognizeContentOptions value.

setPollInterval

public RecognizeContentOptions setPollInterval(Duration pollInterval)

Set the duration between each poll for the operation status. If none is specified, a default of 5 seconds is used.

Parameters:

pollInterval - the duration to specify between each poll for the operation status.

Returns:

the updated RecognizeContentOptions value.

setReadingOrder

public RecognizeContentOptions setReadingOrder(FormReadingOrder readingOrder)

Specifies the order in which recognized text lines are returned. As the sorting order depends on the detected text, it may change across images and OCR version updates. Thus, business logic should be built upon the actual line location instead of order.

Parameters:

readingOrder - the order specifies in which text lines are returned

Returns:

the updated RecognizeContentOptions value.

Applies to