tetengo 1.8.1
A multipurpose library set
Loading...
Searching...
No Matches
nBestIterator.h File Reference

An N-best lattice path iterator. More...

#include <stdbool.h>
#include <tetengo/lattice/constraint.h>
#include <tetengo/lattice/lattice.h>
#include <tetengo/lattice/node.h>
#include <tetengo/lattice/path.h>
+ Include dependency graph for nBestIterator.h:

Go to the source code of this file.

Functions

tetengo_lattice_nBestIterator_t * tetengo_lattice_nBestIterator_create (const tetengo_lattice_lattice_t *p_lattice, const tetengo_lattice_node_t *p_eos_node, tetengo_lattice_constraint_t *p_constraint)
 Creates an iterator.
 
void tetengo_lattice_nBestIterator_destroy (const tetengo_lattice_nBestIterator_t *p_iterator)
 Destroys an iterator.
 
tetengo_lattice_path_t * tetengo_lattice_nBestIterator_createPath (const tetengo_lattice_nBestIterator_t *p_iterator)
 Dereferences the iterator.
 
bool tetengo_lattice_nBestIterator_hasNext (const tetengo_lattice_nBestIterator_t *p_iterator)
 Returns true when the iterator will return more elements.
 
void tetengo_lattice_nBestIterator_next (tetengo_lattice_nBestIterator_t *p_iterator)
 Increments the iterator.
 

Detailed Description

An N-best lattice path iterator.

Copyright (C) 2019-2023 kaoru https://www.tetengo.org/

Function Documentation

◆ tetengo_lattice_nBestIterator_create()

tetengo_lattice_nBestIterator_t * tetengo_lattice_nBestIterator_create ( const tetengo_lattice_lattice_t *  p_lattice,
const tetengo_lattice_node_t p_eos_node,
tetengo_lattice_constraint_t *  p_constraint 
)

Creates an iterator.

The ownership of the constraint pointed by p_constraint is transferred into the iterator. There is no need to destroy the constraint after calling this function.

Parameters
p_latticeA pointer to a lattice.
p_eos_nodeA pointer to an EOS node.
p_constraintA pointer to a constraint.
Returns
A pointer to an iterator. Or NULL on error.

◆ tetengo_lattice_nBestIterator_createPath()

tetengo_lattice_path_t * tetengo_lattice_nBestIterator_createPath ( const tetengo_lattice_nBestIterator_t *  p_iterator)

Dereferences the iterator.

Parameters
p_iteratorA pointer to an iterator.
Returns
A pointer to the path. Or NULL when p_iterator is NULL.

◆ tetengo_lattice_nBestIterator_destroy()

void tetengo_lattice_nBestIterator_destroy ( const tetengo_lattice_nBestIterator_t *  p_iterator)

Destroys an iterator.

Parameters
p_iteratorA pointer to an iterator.

◆ tetengo_lattice_nBestIterator_hasNext()

bool tetengo_lattice_nBestIterator_hasNext ( const tetengo_lattice_nBestIterator_t *  p_iterator)

Returns true when the iterator will return more elements.

Parameters
p_iteratorA pointer to an iterator.
Return values
trueWhen the iterator will return more elements.
falseOtherwise.

◆ tetengo_lattice_nBestIterator_next()

void tetengo_lattice_nBestIterator_next ( tetengo_lattice_nBestIterator_t *  p_iterator)

Increments the iterator.

Parameters
p_iteratorA pointer to an iterator.