Class: Google::Cloud::Language::Annotation::Entities
- Inherits:
-
Array
- Object
- Array
- Google::Cloud::Language::Annotation::Entities
- Defined in:
- lib/google/cloud/language/annotation.rb
Overview
The entities returned by entity analysis.
Instance Attribute Summary collapse
-
#language ⇒ String
The language of the document (if not specified, the language is automatically detected).
Instance Method Summary collapse
-
#artwork ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is
:WORK_OF_ART
. -
#events ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is
:EVENT
. -
#goods ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is
:CONSUMER_GOOD
. -
#locations ⇒ Array<Entity>
(also: #places)
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is
:LOCATION
. -
#organizations ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is
:ORGANIZATION
. -
#other ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is
:OTHER
. -
#people ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is
:PERSON
. -
#unknown ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is
:UNKNOWN
.
Instance Attribute Details
#language ⇒ String
The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are supported.
632 633 634 |
# File 'lib/google/cloud/language/annotation.rb', line 632 def language @language end |
Instance Method Details
#artwork ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :WORK_OF_ART
.
693 694 695 |
# File 'lib/google/cloud/language/annotation.rb', line 693 def artwork select(&:artwork?) end |
#events ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :EVENT
.
684 685 686 |
# File 'lib/google/cloud/language/annotation.rb', line 684 def events select(&:event?) end |
#goods ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :CONSUMER_GOOD
.
702 703 704 |
# File 'lib/google/cloud/language/annotation.rb', line 702 def goods select(&:good?) end |
#locations ⇒ Array<Entity> Also known as: places
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :LOCATION
.
665 666 667 |
# File 'lib/google/cloud/language/annotation.rb', line 665 def locations select(&:location?) end |
#organizations ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :ORGANIZATION
.
675 676 677 |
# File 'lib/google/cloud/language/annotation.rb', line 675 def organizations select(&:organization?) end |
#other ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :OTHER
.
711 712 713 |
# File 'lib/google/cloud/language/annotation.rb', line 711 def other select(&:other?) end |
#people ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :PERSON
.
656 657 658 |
# File 'lib/google/cloud/language/annotation.rb', line 656 def people select(&:person?) end |
#unknown ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :UNKNOWN
.
647 648 649 |
# File 'lib/google/cloud/language/annotation.rb', line 647 def unknown select(&:unknown?) end |