EntityAnnotation
Stay organized with collections
Save and categorize content based on your preferences.
An annotation of a piece of text.
The identified annotation refers to a substring of the text from the start index returned
by getStart()
to the end index returned by getEnd()
,
exclusively, with
getEntities()
returning a list of possible entities it could refer to.
Public Method Summary
boolean |
equals( Object o)
Indicates whether some other object is "equal to" this one.
|
String
|
getAnnotatedText()
The text segment within the original text that this annotation refers to (from
the start index returned by
getStart() to the end index returned by
getEnd() , exclusively).
|
int |
getEnd()
The end index (in Java chars) of the annotation in the original text,
exclusive.
|
List<Entity>
|
getEntities()
A list of possible entities that this annotation could refer to.
|
int |
getStart()
The start index (in Java chars) of the annotation in the original text,
inclusive.
|
int |
hashCode()
Returns a hash code value for the object.
|
String
|
|
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
public boolean equals (Object o)
Indicates whether some other object is "equal to" this one.
public String getAnnotatedText ()
The text segment within the original text that this annotation refers to (from the
start index returned by
getStart()
to the end index returned by
getEnd()
, exclusively).
public int getEnd ()
The end index (in Java chars) of the annotation in the original text, exclusive.
public List<Entity>
getEntities ()
A list of possible entities that this annotation could refer to. It has at least one
entity and order is non-deterministic.
public int getStart ()
The start index (in Java chars) of the annotation in the original text,
inclusive.
public int hashCode ()
Returns a hash code value for the object.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eEntityAnnotation\u003c/code\u003e identifies a specific piece of text within a larger body of text and provides information about it.\u003c/p\u003e\n"],["\u003cp\u003eIt uses start and end indices to pinpoint the location of the annotated text segment.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eEntityAnnotation\u003c/code\u003e also offers a list of potential entities that the annotated text could represent.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can access the annotated text segment and its associated entities through the provided methods such as \u003ccode\u003egetAnnotatedText()\u003c/code\u003e, \u003ccode\u003egetEntities()\u003c/code\u003e, \u003ccode\u003egetStart()\u003c/code\u003e, and \u003ccode\u003egetEnd()\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# EntityAnnotation\n\npublic final class **EntityAnnotation** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nAn annotation of a piece of text.\n\nThe identified annotation refers to a substring of the text from the start index returned\nby [getStart()](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getStart())\nto the end index returned by [getEnd()](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getEnd()),\nexclusively, with [getEntities()](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getEntities()) returning a list of possible entities it could refer to. \n\n### Public Method Summary\n\n|-------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) o) Indicates whether some other object is \"equal to\" this one. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getAnnotatedText](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getAnnotatedText())() The text segment within the original text that this annotation refers to (from the start index returned by [getStart()](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getStart()) to the end index returned by [getEnd()](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getEnd()), exclusively). |\n| int | [getEnd](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getEnd())() The end index (in Java chars) of the annotation in the original text, exclusive. |\n| [List](//developer.android.com/reference/java/util/List.html)\\\u003c[Entity](/android/reference/com/google/mlkit/nl/entityextraction/Entity)\\\u003e | [getEntities](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getEntities())() A list of possible entities that this annotation could refer to. |\n| int | [getStart](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getStart())() The start index (in Java chars) of the annotation in the original text, inclusive. |\n| int | [hashCode](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#hashCode())() Returns a hash code value for the object. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#toString())() Returns a string represents [EntityAnnotation](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation). |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) o)\n\nIndicates whether some other object is \"equal to\" this one. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getAnnotatedText** ()\n\nThe text segment within the original text that this annotation refers to (from the\nstart index returned by [getStart()](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getStart()) to the end index returned by [getEnd()](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation#getEnd()), exclusively). \n\n#### public int **getEnd** ()\n\nThe end index (in Java chars) of the annotation in the original text, exclusive. \n\n#### public [List](//developer.android.com/reference/java/util/List.html)\\\u003c[Entity](/android/reference/com/google/mlkit/nl/entityextraction/Entity)\\\u003e\n**getEntities** ()\n\nA list of possible entities that this annotation could refer to. It has at least one\nentity and order is non-deterministic. \n\n#### public int **getStart** ()\n\nThe start index (in Java chars) of the annotation in the original text,\ninclusive. \n\n#### public int **hashCode** ()\n\nReturns a hash code value for the object. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **toString** ()\n\nReturns a string represents [EntityAnnotation](/android/reference/com/google/mlkit/nl/entityextraction/EntityAnnotation)."]]