A vocabulary.
More...
Go to the source code of this file.
|
tetengo_lattice_vocabulary_t * | tetengo_lattice_vocabulary_createUnorderedMapVocabulary (const tetengo_lattice_keyEntriesPair_t *p_entries, size_t entry_count, const tetengo_lattice_entriesConnectionCostPair_t *p_connections, size_t connection_count, size_t(*p_entry_hash)(const tetengo_lattice_entryView_t *), int(*p_entry_equal_to)(const tetengo_lattice_entryView_t *, const tetengo_lattice_entryView_t *)) |
| Creates an unordered map vocabulary.
|
|
tetengo_lattice_vocabulary_t * | tetengo_lattice_vocabulary_createCustomVocabulary (const tetengo_lattice_customVocabularyDefinition_t *p_definition) |
| Creates a custom vocabulary.
|
|
void | tetengo_lattice_vocabulary_destroy (const tetengo_lattice_vocabulary_t *p_vocabulary) |
| Destroys a vocabulary.
|
|
size_t | tetengo_lattice_vocabulary_findEntries (const tetengo_lattice_vocabulary_t *p_vocabulary, const tetengo_lattice_input_t *p_key, tetengo_lattice_entryView_t *p_entries) |
| Finds entries.
|
|
bool | tetengo_lattice_vocabulary_findConnection (const tetengo_lattice_vocabulary_t *p_vocabulary, const tetengo_lattice_node_t *p_from, const tetengo_lattice_entryView_t *p_to, tetengo_lattice_connection_t *p_connection) |
| Finds a connection between entries.
|
|
A vocabulary.
Copyright (C) 2019-2023 kaoru https://www.tetengo.org/
◆ tetengo_lattice_vocabulary_createCustomVocabulary()
Creates a custom vocabulary.
- Parameters
-
p_definition | A pointer to a definition. |
- Returns
- A pointer to a custom vocabulary. Or NULL when p_definition NULL
◆ tetengo_lattice_vocabulary_createUnorderedMapVocabulary()
Creates an unordered map vocabulary.
- Parameters
-
p_entries | A pointer to entries. |
entry_count | An entry count. |
p_connections | A pointer to connections. |
connection_count | A connection count. |
p_entry_hash | A pointer to a hash function for an entry. |
p_entry_equal_to | A pointer to an eqaul_to function for an entry. |
- Returns
- A pointer to an unordered map vocabulary. Or NULL when p_entries and/or p_connections are NULL, and entry_count and/or connection_count are greater than 0.
◆ tetengo_lattice_vocabulary_destroy()
void tetengo_lattice_vocabulary_destroy |
( |
const tetengo_lattice_vocabulary_t * |
p_vocabulary | ) |
|
Destroys a vocabulary.
- Parameters
-
p_vocabulary | A pointer to a vocabulary. |
◆ tetengo_lattice_vocabulary_findConnection()
Finds a connection between entries.
- Parameters
-
p_vocabulary | A pointer to a vocabulary. |
p_from | A pointer to an origin node. |
p_to | A pointer to a destination entry. |
p_connection | The storage for an output connection. |
- Return values
-
true | When an output connection is stored. |
false | Otherwise. |
◆ tetengo_lattice_vocabulary_findEntries()
size_t tetengo_lattice_vocabulary_findEntries |
( |
const tetengo_lattice_vocabulary_t * |
p_vocabulary, |
|
|
const tetengo_lattice_input_t * |
p_key, |
|
|
tetengo_lattice_entryView_t * |
p_entries |
|
) |
| |
Finds entries.
- Parameters
-
p_vocabulary | A pointer to a vocabulary. |
p_key | A pointer to a key. |
p_entries | The storage for output entries. Can be NULL. |
- Returns
- An entry count.