Class Document (2.3.0)

public sealed class Document : IMessage<Document>, IEquatable<Document>, IDeepCloneable<Document>, IBufferMessage, IMessage

Represents the input to API methods.

Inheritance

Object > Document

Namespace

Google.Cloud.Language.V1

Assembly

Google.Cloud.Language.V1.dll

Constructors

Document()

public Document()

Document(Document)

public Document(Document other)
Parameter
NameDescription
otherDocument

Properties

Content

public string Content { get; set; }

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

Property Value
TypeDescription
String

GcsContentUri

public string GcsContentUri { get; set; }

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.

Property Value
TypeDescription
String

Language

public string Language { get; set; }

The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.<br> 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.

Property Value
TypeDescription
String

SourceCase

public Document.SourceOneofCase SourceCase { get; }
Property Value
TypeDescription
Document.SourceOneofCase

Type

public Document.Types.Type Type { get; set; }

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

Property Value
TypeDescription
Document.Types.Type

Methods

FromHtml(String, String)

public static Document FromHtml(string html, string language = null)

Constructs a document from an HTML string and optional language.

Parameters
NameDescription
htmlString

The HTML text of the document. Must not be null.

languageString

The language of the document, as an ISO or BCP-47 language code. This may be empty or null (the default), in which case the language will be detected by the Natural Language service.

Returns
TypeDescription
Document

The newly created document.

FromPlainText(String, String)

public static Document FromPlainText(string text, string language = null)

Constructs a document from a plain text string and optional language.

Parameters
NameDescription
textString

The text of the document. Must not be null.

languageString

The language of the document, as an ISO or BCP-47 language code. This may be empty or null (the default), in which case the language will be detected by the Natural Language service.

Returns
TypeDescription
Document

The newly created document.