Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

EntityConfig

class EntityConfig
kotlin.Any
   ↳ androidx.textclassifier.TextClassifier.EntityConfig

Configuration object for specifying what entities to identify. Configs are initially based on a predefined preset, and can be modified from there.

Summary

Nested classes

Builder class to construct the EntityConfig object.

Public methods

static TextClassifier.EntityConfig
createFromBundle(@NonNull bundle: Bundle)

Extracts an EntityConfig from a bundle that was added using toBundle().

MutableCollection<String!>

Retrieves the list of hints.

MutableCollection<String!>!
resolveEntityTypes(@Nullable defaultEntityTypes: MutableCollection<String!>?)

Returns a final list of entity types that the text classifier should look for.

Boolean

Return whether the client allows the text classifier to include its own list of default entity types.

Bundle

Adds this EntityConfig to a Bundle that can be read back with the same parameters to createFromBundle(Bundle).

Public methods

createFromBundle

@NonNull static fun createFromBundle(@NonNull bundle: Bundle): TextClassifier.EntityConfig

Extracts an EntityConfig from a bundle that was added using toBundle().

getHints

@NonNull fun getHints(): MutableCollection<String!>

Retrieves the list of hints.

Return
MutableCollection<String!>: An unmodifiable collection of the hints.

resolveEntityTypes

fun resolveEntityTypes(@Nullable defaultEntityTypes: MutableCollection<String!>?): MutableCollection<String!>!

Returns a final list of entity types that the text classifier should look for.

NOTE: This method is intended for use by text classifier.

Parameters
defaultEntityTypes MutableCollection<String!>?: entity types the text classifier thinks should be included before factoring in the included/excluded entity types given by the client.

shouldIncludeDefaultEntityTypes

fun shouldIncludeDefaultEntityTypes(): Boolean

Return whether the client allows the text classifier to include its own list of default entity types. If this functions returns true, text classifier can consider to specify its own list in resolveEntityTypes(Collection).

NOTE: This method is intended for use by text classifier.

toBundle

@NonNull fun toBundle(): Bundle

Adds this EntityConfig to a Bundle that can be read back with the same parameters to createFromBundle(Bundle).