.. _f-completion: module ``nlp.completion`` ========================= .. inheritance-diagram:: mlstatpy.nlp.completion Short summary +++++++++++++ module ``mlstatpy.nlp.completion`` About completion :githublink:`%|py|5` Classes +++++++ +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ | class | truncated documentation | +==========================================================================+==========================================================================================================================+ | :class:`CompletionTrieNode ` | Node definition in a trie used to do completion, see :ref:`l-completion0`. This implementation is not very efficient ... | +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ Properties ++++++++++ +----------------------------------------------------------------+------------------------------------------+ | property | truncated documentation | +================================================================+==========================================+ | :meth:`root ` | Returns the initial node with no parent. | +----------------------------------------------------------------+------------------------------------------+ Static Methods ++++++++++++++ +------------------------------------------------------------------+-------------------------+ | staticmethod | truncated documentation | +==================================================================+=========================+ | :meth:`build ` | Builds a trie. | +------------------------------------------------------------------+-------------------------+ Methods +++++++ +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +====================================================================================================+==============================================================================================================================+ | :py:meth:`__init__ ` | | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__iter__ ` | Iterates on all nodes (sorted). | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__str__ ` | usual | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_add ` | Adds a child. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`all_completions ` | Retrieves all completions for a node, the method does not need :meth:`precompute_stat` to be run first. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`all_mks_completions ` | Retrieves all completions for a node, the method assumes :meth:`precompute_stat` was run. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`find ` | Returns the node which holds all completions starting with a given prefix. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`items ` | Iterates on children, iterates on weight, key, child. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`items_list ` | All children nodes inluding itself in a list. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`iter_leaves ` | Iterators on leaves sorted per weight, yield weight, value. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`leaves ` | Iterators on leaves. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`min_dynamic_keystroke ` | Returns the dynamic minimum keystrokes for a word. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`min_dynamic_keystroke2 ` | Returns the modified dynamic minimum keystrokes for a word. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`min_keystroke ` | Returns the minimum keystrokes for a word without optimisation, this function should be used if you only have a ... | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`min_keystroke0 ` | Returns the minimum keystrokes for a word. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`precompute_stat ` | Computes and stores list of completions for each node, computes *mks*. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`str_all_completions ` | Builds a string with all completions for all prefixes along the paths. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`unsorted_iter ` | Iterates on all nodes. | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ | :meth:`update_stat_dynamic ` | Must be called after :meth:`precompute_stat` and computes dynamic mks (see :ref:`Dynamic Minimum Keystroke `). ... | +----------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlstatpy.nlp.completion :members: :special-members: __init__ :show-inheritance: