目录

MLDocumentSetting

Class Info

com.huawei.hms.mlsdk.document.MLDocumentSetting

Sets the attributes of the document analyzer (MLDocumentAnalyzer).

The analyzer attributes include:
  • Preset languages: Set languages for the analyzer correctly to ensure fast and accurate detection.
  • Whether to enable certificate fingerprint verification. If this parameter is set to true, only registered apps that pass the verification are allowed to access the cloud API for document detection.
  • Type of the text line bounding box. The value can be NGON or ARC. NGON: Returns the coordinates of the four corner points of the text line bounding box that is a quadrilateral. ARC: Returns the coordinates of up to 72 corner points of the text line bounding box that is a polygon for text in a curved layout.

Public Method Summary

Qualifier and Type

Method Name and Description

boolean

equals(Object setting)

Determines whether the input instance is equal to the current instance.

String

getBorderType()

Obtains the type of a text line bounding box.

List<String>

getLanguageList()

Obtains the languages preset in the document analyzer.

int

hashCode()

Obtains the hash value of the current instance.

boolean

isEnableFingerprintVerification()

Determines whether to enable certificate fingerprint verification.

Public Methods

[h2]equals(Object setting)

Method

public boolean equals(Object setting)

Determines whether the input instance is equal to the current instance.

Parameters

Name

Description

setting

Instance to be compared.

Return

Type

Description

boolean

  • true: The two instances are equal.
  • false: The two instances are different.

[h2]getBorderType()

Method

public String getBorderType()

Obtains the type of a text line bounding box.

Return

Type

Description

String

Type of the text line bounding box.
  • NGON: coordinates of the four vertices of a text line bounding box that is a quadrilateral.
  • ARC: coordinates of up to 72 vertices of a text bounding box that is a polygon for text in a curved layout.

[h2]getLanguageList()

Method

public List<String> getLanguageList()

Obtains the languages preset in the document analyzer.

Return

Type

Description

List<String>

A list of languages.

Language codes: en (English), zh (Chinese), ja (Japanese), ko (Korean), ru (Russian), de (German), fr (French), it (Italian), pt (Portuguese), es (Spanish), pl (Polish), no (Norwegian), sv (Swedish), da (Danish), tr (Turkish), fi (Finnish), th (Thai), ar (Arabic), and hi (Hindi)

[h2]hashCode()

Method

public int hashCode()

Obtains the hash value of the current instance.

Return

Type

Description

int

Hash value of the current instance.

[h2]isEnableFingerprintVerification()

Method

public final boolean isEnableFingerprintVerification()

Determines whether to enable certificate fingerprint verification.

Return

Type

Description

boolean

  • true: Certificate fingerprint verification is enabled. Only registered apps that pass the verification are allowed to access the cloud API for document recognition.
  • false: Certificate fingerprint verification is disabled. There is no restriction on access to the cloud API for document recognition.