.. _f-completionsimple: module ``nlp.completion_simple`` ================================ .. inheritance-diagram:: mlstatpy.nlp.completion_simple Short summary +++++++++++++ module ``mlstatpy.nlp.completion_simple`` About completion, simple algorithm :githublink:`%|py|5` Classes +++++++ +-------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | class | truncated documentation | +===============================================================================+=====================================================================================+ | :class:`CompletionElement ` | Definition of an element in a completion system, it contains the following members: | +-------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ | :class:`CompletionSystem ` | define a completion system | +-------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ Static Methods ++++++++++++++ +--------------------------------------------------------------------------------------+------------------------------------------------+ | staticmethod | truncated documentation | +======================================================================================+================================================+ | :meth:`empty_prefix ` | return an instance filled with an empty prefix | +--------------------------------------------------------------------------------------+------------------------------------------------+ Methods +++++++ +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +=======================================================================================================+=====================================================================================================================+ | :py:meth:`__getitem__ ` | Returns ``elements[i]``. | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | constructor | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | fill the completion system | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__iter__ ` | Iterates over elements. | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__len__ ` | Number of elements. | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__repr__ ` | usual | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`compare_with_trie ` | Compares the results with the other implementation. | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`compute_metrics ` | Computes the metric for the completion itself. | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`enumerate_test_metric ` | Evaluates the completion set on a set of queries, the function returns a list of :class:`CompletionElement` ... | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`find ` | Not very efficient, finds an item in a the list. | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`init_metrics ` | initiate the metrics | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`items ` | Iterates on ``(e.value, e)``. | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`sort_values ` | sort the elements by value | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`sort_weight ` | Sorts the elements by value. | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`str_all_completions ` | builds a string with all completions for all prefixes along the paths, this is only available if parameter ... | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`str_mks ` | return a string with metric information | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`str_mks0 ` | return a string with metric information | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`test_metric ` | Evaluates the completion set on a set of queries, the function returns a dictionary with the aggregated metrics ... | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`to_dict ` | Returns a dictionary. | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`tuples ` | Iterates on ``(e.weight, e.value)``. | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :meth:`update_metrics ` | update the metrics | +-------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: mlstatpy.nlp.completion_simple :members: :special-members: __init__ :show-inheritance: