Class: Google::Cloud::Language::V1::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb

Overview

================================================================ #

Represents the input to API methods.

Defined Under Namespace

Modules: Type

Instance Attribute Summary collapse

Instance Attribute Details

#contentString

Returns The content of the input in string format.

Returns:

  • (String)

    The content of the input in string format.



48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb', line 48

class Document
  # The document types enum.
  module Type
    # The content type is not specified.
    TYPE_UNSPECIFIED = 0

    # Plain text
    PLAIN_TEXT = 1

    # HTML
    HTML = 2
  end
end

#gcs_content_uriString

Returns 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:

  • (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.



48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb', line 48

class Document
  # The document types enum.
  module Type
    # The content type is not specified.
    TYPE_UNSPECIFIED = 0

    # Plain text
    PLAIN_TEXT = 1

    # HTML
    HTML = 2
  end
end

#languageString

Returns The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.
Current Language Restrictions:

  • Only English, Spanish, and Japanese textual content are supported, with the following additional restriction:
    • +analyzeSentiment+ only supports English text. 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:

  • (String)

    The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.
    Current Language Restrictions:

    • Only English, Spanish, and Japanese textual content are supported, with the following additional restriction:
      • +analyzeSentiment+ only supports English text. 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.


48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb', line 48

class Document
  # The document types enum.
  module Type
    # The content type is not specified.
    TYPE_UNSPECIFIED = 0

    # Plain text
    PLAIN_TEXT = 1

    # HTML
    HTML = 2
  end
end

#typeGoogle::Cloud::Language::V1::Document::Type

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

Returns:



48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb', line 48

class Document
  # The document types enum.
  module Type
    # The content type is not specified.
    TYPE_UNSPECIFIED = 0

    # Plain text
    PLAIN_TEXT = 1

    # HTML
    HTML = 2
  end
end