# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_cons.ipynb.

# %% auto 0
__all__ = ['U1', 'NIL', 'ATTR', 'PUNC', 'P', 'SensitivityKeywords', 'StringMatchKeywords']

# %% ../nbs/00_cons.ipynb 4
import re, difflib, string
from types import ModuleType
from typing import Any, Self, Optional, ParamSpec, TypedDict

# %% ../nbs/00_cons.ipynb 7
U1 = '_'
NIL = ''

# ATTR = 'attr'
# PUNC = 'punc'
ATTR = re.compile(r'\s+|_')
PUNC = re.compile(rf'[{re.escape(string.punctuation)}]')

# %% ../nbs/00_cons.ipynb 9
P = ParamSpec('P')

class SensitivityKeywords(TypedDict):
    icase: bool
    'Whether to ignore case when matching, by default True.';
    ispace: bool
    'Whether to ignore spaces when matching, by default True.';
    iunder: bool
    'Whether to ignore underscores when matching, by default True.';
    
class StringMatchKeywords(SensitivityKeywords):
    n: int
    'The maximum number of close matches to return; here, it is either 0 or 1, by default 1.';
    cutoff: float = 0.8
    'The similarity ratio (0 <= ratio <= 1) below which matches are not considered, by default 0.8.';
    icase: bool
    'Whether to ignore case when matching, by default True.';
    ispace: bool
    'Whether to ignore spaces when matching, by default True.';
    iunder: bool
    'Whether to ignore underscores when matching, by default True.';
