Dazzle.FuzzyMutableIndex¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Dazzle.FuzzyMutableIndex¶
- classmethod new(case_sensitive)¶
- Parameters:
- Returns:
A newly allocated #Fuzzy that should be freed with
Dazzle.FuzzyMutableIndex.unref
().- Return type:
Create a new #Fuzzy for fuzzy matching strings.
- classmethod new_with_free_func(case_sensitive, free_func)¶
- Parameters:
case_sensitive (
bool
) –free_func (
GLib.DestroyNotify
) –
- Return type:
- begin_bulk_insert()¶
Start a bulk insertion. self is not ready for searching until
Dazzle.FuzzyMutableIndex.end_bulk_insert
() has been called.This allows for inserting large numbers of strings and deferring the final sort until
Dazzle.FuzzyMutableIndex.end_bulk_insert
().
- end_bulk_insert()¶
Complete a bulk insert and resort the index.
- insert(key, value)¶
- Parameters:
Inserts a string into the fuzzy matcher.
- match(needle, max_matches)¶
- Parameters:
- Returns:
A newly allocated
GLib.Array
containing #FuzzyMatch elements. This should be freed when the caller is done with it using g_array_unref(). It is a programming error to keep the structure around longer than the self instance.- Return type:
Dazzle.FuzzyMutableIndex
searches within self for strings that fuzzy match needle. Only up to max_matches will be returned.TODO: max_matches is not yet respected.
- ref()¶
- Return type:
- set_free_func(free_func)¶
- Parameters:
free_func (
GLib.DestroyNotify
) –
- unref()¶
Decrements the reference count of fuzzy by one. When the reference count reaches zero, the structure will be freed.