class TextLinks.Builder


A builder to construct a TextLinks instance.

Summary

Public constructors

Builder(fullText: CharSequence)

Create a new TextLinks.Builder.

Public functions

TextLinks.Builder
addLink(start: Int, end: Int, entityScores: (Mutable)Map<String!, Float!>)

Adds a TextLink.

TextLinks

Constructs a TextLinks instance.

TextLinks.Builder

Removes all TextLinks.

TextLinks.Builder
setExtras(extras: Bundle?)

Sets the extended, vendor specific data.

Public constructors

Builder

Builder(fullText: CharSequence)

Create a new TextLinks.Builder.

Parameters
fullText: CharSequence

The full text to annotate with links.

Public functions

addLink

fun addLink(start: Int, end: Int, entityScores: (Mutable)Map<String!, Float!>): TextLinks.Builder

Adds a TextLink.

Returns
TextLinks.Builder

this instance.

Throws
java.lang.IllegalArgumentException

if entityScores is null or empty.

build

fun build(): TextLinks

Constructs a TextLinks instance.

Returns
TextLinks

the constructed TextLinks.

clearTextLinks

fun clearTextLinks(): TextLinks.Builder

Removes all TextLinks.

setExtras

fun setExtras(extras: Bundle?): TextLinks.Builder

Sets the extended, vendor specific data.