Contents

tagHypotheses(at:unit:scheme:maximumCount:)

Finds multiple possible tags for a given linguistic unit, for a single scheme, at the specified character position.

Declaration

@nonobjc func tagHypotheses(at index: String.Index, unit: NLTokenUnit, scheme: NLTagScheme, maximumCount: Int) -> ([String : Double], Range<String.Index>)

Parameters

  • index:

    The position of the initial character.

  • unit:

    The linguistic unit. See Nltokenunit for possible values.

  • scheme:

    The tag scheme. See Nltagscheme for possible values. Not all tag schemes produce more than one prediction.

  • maximumCount:

    The maximum number of tag predictions to return.

Return Value

A tuple containing a dictionary and a range.

Discussion

Each dictionary entry is a predicted tag with its associated probability score. These tags are the top candidates proposed as possible tags for the token. The dictionary contains up to maximumCount entries.

The range contains the range of the individual token for which these tags were produced.

See Also

Getting linguistic tags