TextClassifier.EntityConfig.Builder

public static final class TextClassifier.EntityConfig.Builder
extends Object

java.lang.Object
   ↳ androidx.textclassifier.TextClassifier.EntityConfig.Builder


Builder class to construct the TextClassifier.EntityConfig object.

Summary

Public constructors

TextClassifier.EntityConfig.Builder()

Public methods

TextClassifier.EntityConfig build()

Combines all of the options that have been set and returns a new TextClassifier.EntityConfig object.

TextClassifier.EntityConfig.Builder setExcludedEntityTypes(Collection<String> excludedEntityTypes)

Sets a collection of entity types that are explicitly excluded.

TextClassifier.EntityConfig.Builder setHints(Collection<String> hints)

Sets a collection of hints for the text classifier to determine what types of entities to find.

TextClassifier.EntityConfig.Builder setIncludeDefaultEntityTypes(boolean includeDefaultEntityTypes)

Specifies to include the default entity types suggested by the text classifier.

TextClassifier.EntityConfig.Builder setIncludedEntityTypes(Collection<String> includedEntityTypes)

Sets a collection of entity types that are explicitly included.

Inherited methods

Public constructors

TextClassifier.EntityConfig.Builder

public TextClassifier.EntityConfig.Builder ()

Public methods

build

public TextClassifier.EntityConfig build ()

Combines all of the options that have been set and returns a new TextClassifier.EntityConfig object.

Returns
TextClassifier.EntityConfig

setExcludedEntityTypes

public TextClassifier.EntityConfig.Builder setExcludedEntityTypes (Collection<String> excludedEntityTypes)

Sets a collection of entity types that are explicitly excluded.

Parameters
excludedEntityTypes Collection

Returns
TextClassifier.EntityConfig.Builder

setHints

public TextClassifier.EntityConfig.Builder setHints (Collection<String> hints)

Sets a collection of hints for the text classifier to determine what types of entities to find.

Parameters
hints Collection

Returns
TextClassifier.EntityConfig.Builder

setIncludeDefaultEntityTypes

public TextClassifier.EntityConfig.Builder setIncludeDefaultEntityTypes (boolean includeDefaultEntityTypes)

Specifies to include the default entity types suggested by the text classifier. By default, it is included.

Parameters
includeDefaultEntityTypes boolean

Returns
TextClassifier.EntityConfig.Builder

setIncludedEntityTypes

public TextClassifier.EntityConfig.Builder setIncludedEntityTypes (Collection<String> includedEntityTypes)

Sets a collection of entity types that are explicitly included.

Parameters
includedEntityTypes Collection

Returns
TextClassifier.EntityConfig.Builder