An N-best lattice path iterator.
More...
Go to the source code of this file.
An N-best lattice path iterator.
Copyright (C) 2019-2023 kaoru https://www.tetengo.org/
◆ 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_lattice | A pointer to a lattice. |
p_eos_node | A pointer to an EOS node. |
p_constraint | A 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_iterator | A 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_iterator | A 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_iterator | A pointer to an iterator. |
- Return values
-
true | When the iterator will return more elements. |
false | Otherwise. |
◆ tetengo_lattice_nBestIterator_next()
void tetengo_lattice_nBestIterator_next |
( |
tetengo_lattice_nBestIterator_t * |
p_iterator | ) |
|
Increments the iterator.
- Parameters
-
p_iterator | A pointer to an iterator. |