<commit_before>.. _extended_fns:

Extended predicate/mapper semantics
===================================

Many of funcy functions expecting predicate or mapping function as an argument can take something uncallable instead of it with semantics described in this table:

============  ================================= =================================
f passed      Predicate                         Mapping function
============  ================================= =================================
callable      f                                 f
``None``      bool                              :func:`identity <identity>`
string        :func:`re_tester(f) <re_tester>`  :func:`re_finder(f) <re_finder>`
int or slice  ``itemgetter(f)``                 ``itemgetter(f)``
mapping       ``f.get``                         ``f.get``
set           ``lambda x: x in f``              ``lambda x: x in f``
============  ================================= =================================


Supporting functions
--------------------
<commit_msg>Removed nonsensical line from extends fns table<commit_after>.. _extended_fns:

Extended predicate/mapper semantics
===================================

Many of funcy functions expecting predicate or mapping function as an argument can take something uncallable instead of it with semantics described in this table:

============  ================================= =================================
f passed      Predicate                         Mapping function
============  ================================= =================================
``None``      bool                              :func:`identity <identity>`
string        :func:`re_tester(f) <re_tester>`  :func:`re_finder(f) <re_finder>`
int or slice  ``itemgetter(f)``                 ``itemgetter(f)``
mapping       ``f.get``                         ``f.get``
set           ``lambda x: x in f``              ``lambda x: x in f``
============  ================================= =================================


Supporting functions
--------------------

{'fraction_non_alphanumeric': 0.3446601941747573, 'fraction_numerical': 0.0, 'mean_word_length': 2.7678244972577697, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5356380', 'n_tokens_mistral': 465, 'n_tokens_neox': 414, 'n_words': 139}