One Logo Pool Ball
NaturalLanguage · IOS API REFERENCE

NLEmbedding

class · iOS 13.0+ · SDK 27.1

class NLEmbedding

Members (19)

static · iOS 13.0+

currentRevision

TypeScript
static currentRevision(language: NLLanguage): number
Swift declaration
class func currentRevision(for language: NLLanguage) -> Int
static · iOS 14.0+

currentSentenceEmbeddingRevision

TypeScript
static currentSentenceEmbeddingRevision(language: NLLanguage): number
Swift declaration
class func currentSentenceEmbeddingRevision(for language: NLLanguage) -> Int
init · iOS 13.0+

init

TypeScript
static init(url: string): NLEmbedding
Swift declaration
convenience init(contentsOf url: URL) throws
static · iOS 14.0+

sentenceEmbedding

TypeScript
static sentenceEmbeddingFor(language: NLLanguage): (NLEmbedding) | null
Swift declaration
class func sentenceEmbedding(for language: NLLanguage) -> NLEmbedding?
static · iOS 14.0+

sentenceEmbedding

TypeScript
static sentenceEmbeddingForRevision(language: NLLanguage, revision: number): (NLEmbedding) | null
Swift declaration
class func sentenceEmbedding(for language: NLLanguage, revision: Int) -> NLEmbedding?
static · iOS 13.0+

supportedRevisions

TypeScript
static supportedRevisions(language: NLLanguage): _Foundation_IndexSet
Swift declaration
class func supportedRevisions(for language: NLLanguage) -> IndexSet
static · iOS 14.0+

supportedSentenceEmbeddingRevisions

TypeScript
static supportedSentenceEmbeddingRevisions(language: NLLanguage): _Foundation_IndexSet
Swift declaration
class func supportedSentenceEmbeddingRevisions(for language: NLLanguage) -> IndexSet
static · iOS 13.0+

wordEmbedding

TypeScript
static wordEmbeddingFor(language: NLLanguage): (NLEmbedding) | null
Swift declaration
class func wordEmbedding(for language: NLLanguage) -> NLEmbedding?
static · iOS 13.0+

wordEmbedding

TypeScript
static wordEmbeddingForRevision(language: NLLanguage, revision: number): (NLEmbedding) | null
Swift declaration
class func wordEmbedding(for language: NLLanguage, revision: Int) -> NLEmbedding?
method · iOS 13.0+

contains

TypeScript
contains(string: string): boolean
Swift declaration
func contains(_ string: String) -> Bool
get · iOS 13.0+

dimension

TypeScript
get dimension(): number
Swift declaration
var dimension: Int { get }
get · iOS 13.0+

language

TypeScript
get language(): (NLLanguage) | null
Swift declaration
var language: NLLanguage? { get }
get · iOS 13.0+

revision

TypeScript
get revision(): number
Swift declaration
var revision: Int { get }
get · iOS 13.0+

vocabularySize

TypeScript
get vocabularySize(): number
Swift declaration
var vocabularySize: Int { get }
static · iOS 13.0+

write

TypeScript
static write(dictionary: Record<string, Array<number>>, language: (NLLanguage) | null, revision: number, url: string): void
Swift declaration
@nonobjc class func write(_ dictionary: [String : [Double]], language: NLLanguage?, revision: Int, to url: URL) throws
method · iOS 13.0+

vector

TypeScript
vector(string: string): (Array<number>) | null
Swift declaration
@nonobjc func vector(for string: String) -> [Double]?
method · iOS 13.0+

distance

TypeScript
distance(firstString: string, secondString: string, distanceType?: NLDistanceType): number
Swift declaration
@nonobjc func distance(between firstString: String, and secondString: String, distanceType: NLDistanceType = .cosine) -> NLDistance
method · iOS 13.0+

neighbors

TypeScript
neighborsForMaximumCountDistanceType(string: string, maxCount: number, distanceType?: NLDistanceType): Array<[string, number]>
Swift declaration
@nonobjc func neighbors(for string: String, maximumCount maxCount: Int, distanceType: NLDistanceType = .cosine) -> [(String, NLDistance)]
method · iOS 13.0+

neighbors

TypeScript
neighborsForMaximumCountDistanceType78787(vector: Array<number>, maxCount: number, distanceType?: NLDistanceType): Array<[string, number]>
Swift declaration
@nonobjc func neighbors(for vector: [Double], maximumCount maxCount: Int, distanceType: NLDistanceType = .cosine) -> [(String, NLDistance)]

Skipped declarations

3 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

NLEmbedding.enumerateNeighbors(for:maximumCount:distanceType:using:)

callback cannot propagate synchronous failure

NLEmbedding.enumerateNeighbors(for:maximumCount:distanceType:using:)

callback cannot propagate synchronous failure

NLEmbedding.init()

inherited init: cannot prove legal (class declares 2 custom initializers)

All NaturalLanguage types →