NTKeywordSpottingSearch Class Reference

Inherits from NTSpeechSearch : NSObject
Declared in NTKeywordSpottingSearch.h
NTKeywordSpottingSearch.m

Overview

A search for trying to recognize one of the keywords in a list.

Other Methods

  keywords

Keyword / Threshold pairs

@property (nonatomic, strong, readonly) NSDictionary<NSString*NSNumber*> *keywords

Discussion

Keyword / Threshold pairs

Declared In

NTKeywordSpottingSearch.h

– initWithName:keywords:

Creates new KWS search with the given name and the keywors.

- (instancetype)initWithName:(NSString *)name keywords:(NSDictionary<NSString*,NSNumber*> *)keywords

Parameters

name

Name

keywords

Keyword/Threshold pairs

Return Value

instance

Discussion

Creates new KWS search with the given name and the keywors.

Declared In

NTKeywordSpottingSearch.h

– addKeyword:

Adds a keyword with the default threshold 1. If the keyword already is in the list threshold 1 is set.

- (void)addKeyword:(NSString *)keyword

Parameters

keyword

Keyword

Discussion

Adds a keyword with the default threshold 1. If the keyword already is in the list threshold 1 is set.

Declared In

NTKeywordSpottingSearch.h

– addKeyword:withThreshold:

Adds the keyword with the given threshold. If the keyword already is in the list the new threshold is set.

- (void)addKeyword:(NSString *)keyword withThreshold:(double)threshold

Parameters

keyword

Keyword

threshold

Threshold

Discussion

Adds the keyword with the given threshold. If the keyword already is in the list the new threshold is set.

Declared In

NTKeywordSpottingSearch.h

– addKeywords:

Add keywords from array with default threshold 1. Same as calling addKeyword for all keywords in the array.

- (void)addKeywords:(NSArray<NSString*> *)keywords

Parameters

keywords

List of keywords

Discussion

Add keywords from array with default threshold 1. Same as calling addKeyword for all keywords in the array.

Declared In

NTKeywordSpottingSearch.h

– addKeywordsFromDictionary:

Add keywords with thresholds from dictionary. Same as calling addKeyword:withThreshold for all pairs in the dictionary.

- (void)addKeywordsFromDictionary:(NSDictionary<NSString*,NSNumber*> *)keywords

Parameters

keywords

Keyword/Threshold pairs

Discussion

Add keywords with thresholds from dictionary. Same as calling addKeyword:withThreshold for all pairs in the dictionary.

Declared In

NTKeywordSpottingSearch.h

– removeKeyword:

Removes the given keyword.

- (void)removeKeyword:(NSString *)keyword

Parameters

keyword

Keyword to remove

Discussion

Removes the given keyword.

Declared In

NTKeywordSpottingSearch.h

– saveToFileAtPath:

Saves the keywords into the file at the given path.

- (void)saveToFileAtPath:(NSString *)path

Parameters

path

Path

Discussion

Saves the keywords into the file at the given path.

Declared In

NTKeywordSpottingSearch.h

– addKeywordsFromFileAtPath:

Add all keywords from the file at the given path.

- (void)addKeywordsFromFileAtPath:(NSString *)path

Parameters

path

path

Discussion

Add all keywords from the file at the given path.

Declared In

NTKeywordSpottingSearch.h

+ parseKeywordsFromFileAtPath:

Parses keywords and optionaly thresholds from file

+ (NSDictionary<NSString*,NSNumber*> *)parseKeywordsFromFileAtPath:(NSString *)path

Parameters

path

Path

Return Value

keyword/threshold pairs

Discussion

Parses keywords and optionaly thresholds from file

KEYWORD /1e-10/ KEYWORD2 /1e-40/

Declared In

NTKeywordSpottingSearch.h

+ searchWithName:keyword:

Create a search with a single keyword.

+ (NTKeywordSpottingSearch *)searchWithName:(NSString *)name keyword:(NSString *)keyword

Parameters

keyword

Keyword

Return Value

instance

Discussion

Create a search with a single keyword.

Declared In

NTKeywordSpottingSearch.h

+ searchWithName:keyword:threshold:

Create a search with a single keyword and a threshold.

+ (NTKeywordSpottingSearch *)searchWithName:(NSString *)name keyword:(NSString *)keyword threshold:(double)threshold

Parameters

keyword

Keyword

threshold

Threshold

Return Value

instance

Discussion

Create a search with a single keyword and a threshold.

Declared In

NTKeywordSpottingSearch.h

+ searchWithName:keywords:

Create a search with keywords from an array.

+ (NTKeywordSpottingSearch *)searchWithName:(NSString *)name keywords:(NSArray<NSString*> *)keywords

Parameters

keywords

List of keywords

Return Value

instance

Discussion

Create a search with keywords from an array.

Declared In

NTKeywordSpottingSearch.h

+ searchWithName:keywordsAndThresholds:

Create a search with keywords and thresholds from a dictionary.

+ (NTKeywordSpottingSearch *)searchWithName:(NSString *)name keywordsAndThresholds:(NSDictionary<NSString*,NSNumber*> *)keywords

Parameters

keywords

Keyword/Threshold pairs

Return Value

instance

Discussion

Create a search with keywords and thresholds from a dictionary.

Declared In

NTKeywordSpottingSearch.h

+ searchWithName:andKeywordsFromFileAtPath:

Creates a search with the keywords from a file.

+ (NTKeywordSpottingSearch *)searchWithName:(NSString *)name andKeywordsFromFileAtPath:(NSString *)path

Parameters

path

Path to the file

Discussion

Creates a search with the keywords from a file.

Declared In

NTKeywordSpottingSearch.h

Other Methods

– initWithName:

Creates search with the given name.

- (instancetype)initWithName:(NSString *)name

Parameters

name

Name

Return Value

Instance

Discussion

Creates search with the given name.

Declared In

NTSpeechSearch.h

+ parseKeywordsFromString:

+ (NSDictionary<NSString*,NSNumber*> *)parseKeywordsFromString:(NSString *)keywordString

– copyWithZone:

- (id)copyWithZone:(NSZone *)zone

Extension Methods

  keywordsInternal

@property (nonatomic, strong) NSMutableDictionary *keywordsInternal