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 includeTypesFromTextClassifier(boolean includeTypesFromTextClassifier)

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

TextClassifier.EntityConfig.Builder setExcludedTypes(Collection<String> excludedTypes)

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 setIncludedTypes(Collection<String> includedTypes)

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

includeTypesFromTextClassifier

public TextClassifier.EntityConfig.Builder includeTypesFromTextClassifier (boolean includeTypesFromTextClassifier)

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

Parameters
includeTypesFromTextClassifier boolean

Returns
TextClassifier.EntityConfig.Builder

setExcludedTypes

public TextClassifier.EntityConfig.Builder setExcludedTypes (Collection<String> excludedTypes)

Sets a collection of entity types that are explicitly excluded.

Parameters
excludedTypes 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

setIncludedTypes

public TextClassifier.EntityConfig.Builder setIncludedTypes (Collection<String> includedTypes)

Sets a collection of entity types that are explicitly included.

Parameters
includedTypes Collection

Returns
TextClassifier.EntityConfig.Builder