ó
    [«Ñg+  ã                   óN   • S SK Jr   " S S\5      r " S S5      r " S S5      rg)	é    )ÚEnumc                   ó$   • \ rS rSrSrSrSrSrSrg)ÚQueryPresenceé   zBDefines possible behaviours for the term's presence in a document.é   é   é   © N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚOPTIONALÚREQUIREDÚ
PROHIBITEDÚ__static_attributes__r
   ó    Ú,/usr/lib/python3/dist-packages/lunr/query.pyr   r      s   † ÙLà€HØ€HØƒJr   r   c                   óF   • \ rS rSrSrSrSrSrSrS r	S r
S	 rS
 rS rSrg)ÚQueryé   zóA `lunr.Query` provides a programmatic way of defining queries to be
performed against a `lunr.Index`.

Prefer constructing a `lunr.Query` using `the lunr.Index.query` method
so the query object is pre-initialized with the right index fields.
Ú*r   r   r   c                 ó   • / U l         Xl        g ©N)ÚclausesÚ
all_fields)Úselfr   s     r   Ú__init__ÚQuery.__init__   s   € ØˆŒØ$�r   c                 ó˜   • SR                  SR                  U R                  5      SR                  S U R                   5       5      5      $ )Nz <Query fields="{}" clauses="{}">Ú,c              3   ó8   #   • U  H  oR                   v •  M     g 7fr   )Úterm)Ú.0Úcs     r   Ú	<genexpr>Ú!Query.__repr__.<locals>.<genexpr>%   s   é € Ð/MÂ¸1·¶Âùs   ‚)ÚformatÚjoinr   r   ©r   s    r   Ú__repr__ÚQuery.__repr__#   s:   € Ø1×8Ñ8Ø�H‰H�T—_‘_Ó% s§x¡xÑ/MÀÇÂÓ/MÓ'Mó
ð 	
r   c                 ót  • U(       a  [        US   [        5      (       a  US   nO[        U0 UD6nUR                  (       d  U R                  Ul        UR                  [
        R                  -  (       aC  UR                  S   [
        R                  :w  a"  [
        R                  UR                  -   Ul        UR                  [
        R                  -  (       aC  UR                  S   [
        R                  :w  a"  UR                  [
        R                  -   Ul        U R                  R                  U5        U $ )a_  Adds a `lunr.Clause` to this query.

Unless the clause contains the fields to be matched all fields will be
matched. In addition a default boost of 1 is applied to the clause.

If the first argument is a `lunr.Clause` it will be mutated and added,
otherwise args and kwargs will be used in the constructor.

Returns:
    lunr.Query: The Query itself.
r   éÿÿÿÿ)Ú
isinstanceÚClauseÚfieldsr   Úwildcardr   ÚWILDCARD_LEADINGr$   ÚWILDCARDÚWILDCARD_TRAILINGr   Úappend)r   ÚargsÚkwargsÚclauses       r   r:   ÚQuery.clause(   sÌ   € ö ”J˜t A™w¬×/Ñ/Ø˜!‘W‰Fä˜TÐ, VÑ,ˆFà�}�}Ø ŸO™OˆFŒMà�O‰Oœe×4Ñ4×4Ø�K‰K˜‰NœeŸn™nÓ,äŸ.™.¨6¯;©;Ñ6ˆFŒKà�O‰Oœe×5Ñ5×5Ø�K‰K˜‰OœuŸ~™~Ó-à Ÿ+™+¬¯©Ñ6ˆFŒKà�‰×Ñ˜FÔ#Øˆr   c                 ó°   • [        U[        [        45      (       a  U H  nU R                  " U40 UD6  M     U $ U R                  " [        U5      40 UD6  U $ )a¸  Adds a term to the current query, creating a Clause and adds it to
the list of clauses making up this Query.

The term is not tokenized and used "as is". Any conversion to token
or token-like strings should be performed before calling this method.

For example:
    query.term(lunr.Tokenizer("foo bar"))

Args:
    term (Token or iterable): Token or iterable of tokens to add.
    kwargs (dict): Additional properties to add to the Clause.
)r0   ÚlistÚtupler$   r:   Ústr)r   r$   r9   Úts       r   r$   Ú
Query.termI   sS   € ô �dœT¤5˜M×*Ñ*Û�Ø—	’	˜!Ñ&˜vÔ&ñ ð
 ˆð �KŠKœ˜D›	Ñ, VÒ,àˆr   c                 ó:   • [        S U R                   5       5      $ )z™A negated query is one in which every clause has a presence of
prohibited. These queries require some special processing to return
the expected results.
c              3   óZ   #   • U  H!  oR                   [        R                  :H  v •  M#     g 7fr   )Úpresencer   r   )r%   r:   s     r   r'   Ú#Query.is_negated.<locals>.<genexpr>d   s    é € ð 
ÚFR¸F�O‰Oœ}×7Ñ7Ö7Âlùs   ‚)+)Úallr   r+   s    r   Ú
is_negatedÚQuery.is_negated_   s"   € ô
 ñ 
ØFJÇlÂló
ó 
ð 	
r   )r   r   N)r   r   r   r   r   r5   ÚWILDCARD_NONEr4   r6   r   r,   r:   r$   rG   r   r
   r   r   r   r      s9   † ñð €HØ€MØÐØÐò%ò
ò
òBõ,
r   r   c                   ól   ^ • \ rS rSrSrSSSSS\R                  \R                  4U 4S jjr	S r
S	rU =r$ )
r1   éi   a.  A single clause in a `lunr.Query` contains a term and details on
how to match that term against a `lunr.Index`

Args:
    term (str, optional): The term for the clause.
    field (iterable, optional): The fields for the term to be searched
        against.
    edit_distance (int, optional): The character distance to use, defaults
        to 0.
    use_pipeline (bool, optional): Whether the clause should be pre
        processed by the index's pipeline, default to True.
    boost (int, optional): Boost to apply to the clause, defaults to 1.
    wildcard (Query.WILDCARD_*, optional): Any of the Query.WILDCARD
        constants defining if a wildcard is to be used and how, defaults
        to Query.WILDCARD_NONE.
    presence (QueryPresence, optional): Behaviour for a terms presence
        in a document.
Nr   Tr   c                 óŠ   >• [         TU ]  5         Xl        U=(       d    / U l        X0l        X@l        XPl        X`l        Xpl        g r   )	Úsuperr   r$   r2   Úedit_distanceÚuse_pipelineÚboostr3   rD   )	r   r$   r2   rN   rO   rP   r3   rD   Ú	__class__s	           €r   r   ÚClause.__init__}   s;   ø€ ô 	‰ÑÔØŒ	Ø—l ˆŒØ*ÔØ(ÔØŒ
Ø ŒØ �r   c                 ó8   • SR                  U R                  5      $ )Nz<Clause term="{}">)r)   r$   r+   s    r   r,   ÚClause.__repr__�   s   € Ø#×*Ñ*¨4¯9©9Ó5Ð5r   )rP   rN   r2   rD   r$   rO   r3   )r   r   r   r   r   r   rI   r   r   r   r,   r   Ú__classcell__)rQ   s   @r   r1   r1   i   s:   ø† ñð* ØØØØØ×$Ñ$Ø×'Ñ'÷!÷&6ð 6r   r1   N)Úenumr   r   r   r1   r
   r   r   Ú<module>rW      s+   ðÝ ô�Dô ÷Z
ñ Z
÷z(6ò (6r   