39 #include "kws_detections.h"
46 if (!detections->detect_list)
49 for (gn = detections->detect_list; gn; gn = gnode_next(gn))
50 ckd_free(gnode_ptr(gn));
51 glist_free(detections->detect_list);
52 detections->detect_list = NULL;
56 kws_detections_add(
kws_detections_t *detections,
const char* keyphrase,
int sf,
int ef,
int prob,
int ascr)
60 for (gn = detections->detect_list; gn; gn = gnode_next(gn)) {
62 if (strcmp(keyphrase, det->keyphrase) == 0 && det->sf < ef && det->ef > sf) {
63 if (det->prob < prob) {
77 detection->keyphrase = keyphrase;
78 detection->prob = prob;
79 detection->ascr = ascr;
80 detections->detect_list = glist_add_ptr(detections->detect_list, detection);
92 for (gn = detections->detect_list; gn; gn = gnode_next(gn)) {
94 if (det->ef < frame - delay) {
95 len += strlen(det->keyphrase) + 1;
103 hyp_str = (
char *)ckd_calloc(len,
sizeof(
char));
105 for (gn = detections->detect_list; gn; gn = gnode_next(gn)) {
107 if (det->ef < frame - delay) {
108 memcpy(c, det->keyphrase, strlen(det->keyphrase));
109 c += strlen(det->keyphrase);