PocketSphinx  5.0.0
A small speech recognizer
Public Member Functions | List of all members
ps_seg_t Struct Reference

Segmentation iterator object. More...

#include <pocketsphinx.h>

Public Member Functions

POCKETSPHINX_EXPORT ps_seg_tps_seg_next (ps_seg_t *seg)
POCKETSPHINX_EXPORT const char * ps_seg_word (ps_seg_t *seg)
POCKETSPHINX_EXPORT void ps_seg_frames (ps_seg_t *seg, int *out_sf, int *out_ef)
POCKETSPHINX_EXPORT int32 ps_seg_prob (ps_seg_t *seg, int32 *out_ascr, int32 *out_lscr, int32 *out_lback)
POCKETSPHINX_EXPORT void ps_seg_free (ps_seg_t *seg)

Detailed Description

Segmentation iterator object.

Member Function Documentation

◆ ps_seg_next()

POCKETSPHINX_EXPORT ps_seg_t * ps_seg_next ( ps_seg_t seg)

Get the next segment in a word segmentation.

segSegment iterator.
Updated iterator with the next segment. NULL at end of utterance (the iterator will be freed in this case).

◆ ps_seg_word()

POCKETSPHINX_EXPORT const char * ps_seg_word ( ps_seg_t seg)

Get word string from a segmentation iterator.

segSegment iterator.
Read-only string giving string name of this segment. This is only valid until the next call to ps_seg_next().

◆ ps_seg_frames()

POCKETSPHINX_EXPORT void ps_seg_frames ( ps_seg_t seg,
int *  out_sf,
int *  out_ef 

Get inclusive start and end frames from a segmentation iterator.

These frame numbers are inclusive, i.e. the end frame refers to the last frame in which the given word or other segment was active. Therefore, the actual duration is *out_ef - *out_sf + 1.
segSegment iterator.
out_sfOutput: First frame index in segment.
out_efOutput: Last frame index in segment.

◆ ps_seg_prob()

POCKETSPHINX_EXPORT int32 ps_seg_prob ( ps_seg_t seg,
int32 *  out_ascr,
int32 *  out_lscr,
int32 *  out_lback 

Get language, acoustic, and posterior probabilities from a segmentation iterator.

Unless the -bestpath option is enabled, this function will always return zero (corresponding to a posterior probability of 1.0). Even if -bestpath is enabled, it will also return zero when called on a partial result. Ongoing research into effective confidence annotation for partial hypotheses may result in these restrictions being lifted in future versions.
out_ascrOutput: acoustic model score for this segment.
out_lscrOutput: language model score for this segment.
out_lbackOutput: language model backoff mode for this segment (i.e. the number of words used in calculating lscr). This field is, of course, only meaningful for N-Gram models.
Log posterior probability of current segment. Log is expressed in the log-base used in the decoder. To convert to linear floating-point, use logmath_exp(ps_get_logmath(), pprob).

◆ ps_seg_free()

POCKETSPHINX_EXPORT void ps_seg_free ( ps_seg_t seg)

Finish iterating over a word segmentation early, freeing resources.

The documentation for this struct was generated from the following file: