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.
638 639 640 |
# File 'lib/google/cloud/language/annotation.rb', line 638 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
.
699 700 701 |
# File 'lib/google/cloud/language/annotation.rb', line 699 def artwork select(&:artwork?) end |
#events ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :EVENT
.
690 691 692 |
# File 'lib/google/cloud/language/annotation.rb', line 690 def events select(&:event?) end |
#goods ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :CONSUMER_GOOD
.
708 709 710 |
# File 'lib/google/cloud/language/annotation.rb', line 708 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
.
671 672 673 |
# File 'lib/google/cloud/language/annotation.rb', line 671 def locations select(&:location?) end |
#organizations ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :ORGANIZATION
.
681 682 683 |
# File 'lib/google/cloud/language/annotation.rb', line 681 def organizations select(&:organization?) end |
#other ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :OTHER
.
717 718 719 |
# File 'lib/google/cloud/language/annotation.rb', line 717 def other select(&:other?) end |
#people ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :PERSON
.
662 663 664 |
# File 'lib/google/cloud/language/annotation.rb', line 662 def people select(&:person?) end |
#unknown ⇒ Array<Entity>
Returns the entities for which Google::Cloud::Language::Annotation::Entity#type is :UNKNOWN
.
653 654 655 |
# File 'lib/google/cloud/language/annotation.rb', line 653 def unknown select(&:unknown?) end |