Cloud Natural Language V1beta2 Client - Class Document (0.29.0)

Reference documentation and code samples for the Cloud Natural Language V1beta2 Client class Document.

Represents the input to API methods.

Generated from protobuf message google.cloud.language.v1beta2.Document

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ type int

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error.

↳ content string

The content of the input in string format. Cloud audit logging exempt since it is based on user data.

↳ gcs_content_uri string

The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.

↳ language string

The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.
Language Support lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an INVALID_ARGUMENT error is returned.

↳ reference_web_uri string

The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.

↳ boilerplate_handling int

Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.

getType

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error.

Returns
TypeDescription
int

setType

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getContent

The content of the input in string format.

Cloud audit logging exempt since it is based on user data.

Returns
TypeDescription
string

hasContent

setContent

The content of the input in string format.

Cloud audit logging exempt since it is based on user data.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getGcsContentUri

The Google Cloud Storage URI where the file content is located.

This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.

Returns
TypeDescription
string

hasGcsContentUri

setGcsContentUri

The Google Cloud Storage URI where the file content is located.

This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getLanguage

The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.
Language Support lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an INVALID_ARGUMENT error is returned.

Returns
TypeDescription
string

setLanguage

The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.
Language Support lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an INVALID_ARGUMENT error is returned.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getReferenceWebUri

The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.

Returns
TypeDescription
string

setReferenceWebUri

The web URI where the document comes from. This URI is not used for fetching the content, but as a hint for analyzing the document.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getBoilerplateHandling

Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.

Returns
TypeDescription
int

setBoilerplateHandling

Indicates how detected boilerplate(e.g. advertisements, copyright declarations, banners) should be handled for this document. If not specified, boilerplate will be treated the same as content.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getSource

Returns
TypeDescription
string