
    /hN                     $    S SK Jr   " S S5      rg)    )defaultdictc                   H    \ rS rSrSrSS jrS rSS jrSS jrS r	S	 r
S
rg)
MinimalSet   a  
Find contexts where more than one possible target value can
appear.  E.g. if targets are word-initial letters, and contexts
are the remainders of words, then we would like to find cases like
"fat" vs "cat", and "training" vs "draining".  If targets are
parts-of-speech and contexts are words, then we would like to find
cases like wind (noun) 'air in rapid motion', vs wind (verb)
'coil, wrap'.
Nc                     [        5       U l        [        5       U l        [        [         5      U l        0 U l        U(       a  U H  u  p#nU R                  X#U5        M     gg)z
Create a new minimal set.

:param parameters: The (context, target, display) tuples for the item
:type parameters: list(tuple(str, str, str))
N)set_targets	_contextsr   _seen	_displaysadd)self
parameterscontexttargetdisplays        L/var/www/auris/envauris/lib/python3.13/site-packages/nltk/misc/minimalset.py__init__MinimalSet.__init__   sN      %
,6('2 -7     c                     U R                   U   R                  U5        U R                  R                  U5        U R                  R                  U5        X0R                  X4'   g)a8  
Add a new item to the minimal set, having the specified
context, target, and display form.

:param context: The context in which the item of interest appears
:type context: str
:param target: The item of interest
:type target: str
:param display: The information to be reported for each item
:type display: str
N)r   r   r
   r	   r   )r   r   r   r   s       r   r   MinimalSet.add&   sR     	

7' 	7#&! -4()r   c                     U R                    Vs/ s H#  n[        U R                  U   5      U:  d  M!  UPM%     sn$ s  snf )z
Determine which contexts occurred with enough distinct targets.

:param minimum: the minimum number of distinct target forms
:type minimum: int
:rtype: list
)r
   lenr   )r   minimumcs      r   contextsMinimalSet.contexts<   s4      >>K>aSA-?7-J>KKKs    <<c                 H    X4U R                   ;   a  U R                   X4   $ U$ N)r   )r   r   r   defaults       r   r   MinimalSet.displayF   s(    .>>7"344Nr   c                     / nU R                    H.  nU R                  X5      nU(       d  M  UR                  U5        M0     U$ r    )r	   r   append)r   r   resultr   xs        r   display_allMinimalSet.display_allL   s;    mmFW-Aqa  $ r   c                     U R                   $ r    )r	   )r   s    r   targetsMinimalSet.targetsT   s    }}r   )r
   r   r   r	   r    )   ) )__name__
__module____qualname____firstlineno____doc__r   r   r   r   r'   r*   __static_attributes__ r   r   r   r      s&    3 4,Lr   r   N)collectionsr   r   r4   r   r   <module>r6      s    $J Jr   