ó i;sSc@sVdZddlmZddlmZdefd„ƒYZdefd„ƒYZdS( s'Josu Bermudez i(tSieve(tpos_tagstExactStringMatchcBs/eZdZeZeZeZeZd„Z RS(tESMcCs´t|j|ƒj|||ƒs%tS|djƒ}xh|D]`}|jj|djƒ}||ksˆ|d|ksˆ||dkr<|jd|ƒtSq<W|jd|ƒtS(Ntforms 'ssEXACT MATCH: %ssIGNORED LINK: %s( tsupert __class__tare_coreferenttFalsetlowertgraphtnodetdebugtTrue(tselftentitytmentiont candidatetcandidate_formt mention_xtmention_x_form((s+corefgraph/multisieve/sieves/stringMatch.pyRs!  ( t__name__t __module__t sort_nameR tDISCOURSE_SALIENCERtONLY_FIRST_MENTIONt NO_PRONOUNt NO_STOP_WORDSR(((s+corefgraph/multisieve/sieves/stringMatch.pyR s tRelaxedStringMatchcBs8eZdZeZeZeZeZd„Z d„Z RS(tRSMc CsA|jj|ƒ}|jj|ƒ}g}d}d}d}x|t|ƒD]n\}} | d} | d|dkr||}n| r›tj| ƒr›|}n| rI| dkrI|}qIqIW|rñ||krñg|| D]} | d^qØ}n| r.|r.||kr.g|| D]} | d^q}ndj|ƒjƒS(Nitpostidt,Rt (t graph_buildert get_wordst get_head_wordt enumerateRtwh_wordstjoinR ( RRt mention_wordst mention_headt relaxed_formt head_indext comma_indextwh_indextindextwordtword_pos((s+corefgraph/multisieve/sieves/stringMatch.pyR*4s&    $$cCsıt|j|ƒj|||ƒs%tS|d}|j|ƒ}|dkra|jd||ƒtSx‚|D]z}|jj|}|j|ƒ}|dkrŸqhn||ksË|d|ksË||dkrh|jd||ƒtSqhW|jd||ƒtS(NRts'FILTERED LINK Empty relaxed form: %s %ss 'ssRelaxed exact match: %s %ssIGNORED LINK: %s %s( RRRRR*R R R R (RRRRRtcandidate_relaxed_formRR((s+corefgraph/multisieve/sieves/stringMatch.pyRRs&!     ( RRRR RRRRRR*R(((s+corefgraph/multisieve/sieves/stringMatch.pyR+s N(t __author__tmultisieve.sieves.baseRtresources.tagsetRRR(((s+corefgraph/multisieve/sieves/stringMatch.pyts