m S0VKc@sadkZdkZdefdYZdefdYZdefdYZdefdYZd efd YZed joeZ gZ e D] Z e e q[ GHe i d e i d e e dZeGHgZ e D] Z e e q[ GHx(e D] Z xe D]Ze GeGHqWq Wd e jGHedZedddgjndS(NtPipeItercBstZdZdZRS(NcCs||_d|_dS(Ni(tobjtselftpart _itercount(RR((t6/home/jaagup/public_html/oma/too/10/01/keel/objects.pyt__init__s cCs^t|ii p |it|iidjo tn|id7_|ii|iS(Ni(tlenRRt_dsRt StopIteration(R((Rtnext s4 (t__name__t __module__RR (((RRs tPipecBstZdZdZdZdZdZdZdZe dZ d Z d Z d Z d Zd ZdZdZdZdZRS(NcCs:g|_g|_g|_g|_t|_d|_dS(Ni(RRt _rulematchest _rulepartst _partlengthtFalsetskippedt partcount(R((RRs      cCs t|S(N(RR(R((Rt__iter__scCs7dig}|D]}||iidq~S(Nt sutf-8(tjoint_[1]RtwtgetWordtencode(RRR((Rt__str__scCs|ii|dS(N(RRtappendto(RR((RR scCsug}t}xbt|D]T\}}|ido+|i|||}|oPng}n|i |qW|S(Ns CLB ( ttmpRtrt enumerateRtiRt hasMarkingt_matchtruletrulesR(RR$R%RR!RR((Rtmatch#s  cCs[|i}|i} |i}d|_t }t i |}t i |}|io|Snt }d} t } |idjo t} n| o dGHn| o |GHn| o dG|GHnd|_td|_t }t|}x t|D]\}}|djo|ido dGHn|i o/| o dG|GHn|i!o d} qqn|id |_|pxt } xX| D]P} |i$d o:| o d GHnt i |}|id |_t} PqqW| od|_qn|i%d}| o d G|GHn|i$||p| o | GHn||jo`| |joS| o d GHn| o&|i$| | o|i'dPq| djoPqq|i'dPn| o dG|GHn|} t|djo t}qq|i$d oPqqWt|djo:t|t|i|_| o dG|GHnt}n|S(Nitdoc_441779960552_itemsalgus!sreegel:is@FMVskahtlane lause s jatan vaheleis CLB sclb asisrule:sdoing prev matching!Rsmatch!s rule match:((R%t skip_listtskiplistt restart_listtrestarttallowed_lookbackstallowed_look_backsRRRRtcopyR$trule_bakt isSkippedt doContinuetNonetprev_rptdt documentidtTruet partlengthtfloattcoeftfind_clbRt rule_lengthR tsentenceR!Rt infoContainst isIgnoredtnull_prev_on_skipt doRestarttremarkR"tpoptrpR(RR$R%R<R/R;RCR-R1R3R@R+RAR4R!RRR:R)((RR#/s                               cCs:|ii||ii|i|ii|idS(N(RRRtridRRRR9(RRD((Rt addRuleMatchsc Csg}g}|i} |i} |i} |i o |gSnx{t |D]m\}}|o|iGn|io|o dGHqLqLn|o dGHnt}x;| D]3}|i|o|i|g}t}qqW|px| D]z} |i| | oa| |ijo9t|djo&| |djo|i| qbn|i| t}PqqWn| o<t|djo)|odG|iG|iGHnPqLqLW|S(s' searchables - a list of allowed marks s IGNOREDtiis show-stopper:N(t all_rulesR$tconftneededt searchablesR(R)R*R+RR0R R!RtdebugtgetInfoR>Rthas_markRAR"RR6tsR,RR( RRHRKRARR!R$RGRMRNRJR)R+((RtgetPossibleRulesP          #   cCs t|_dS(N(R6RR(R((RtskipMescCs|iS(N(RR(R((RR0scCst}xh|D]`}xK|iD]=}x4|dD](}||jo|it }Pq1q1Wq W|oPq q WxL|D]D}x:|dD].}|i i |jo|iPqqWPqxWdS(Ntmarkstwords( RtfoundRRRLtinfostrlistRRPR6trwRtlower(RRURRVRRSRT((Rt checkFullstops*         cCs?x8|D]0}|ii|jo|itqqWdS(N(RRRRWtwlistt setIgnoredR6(RRYR((RtcheckIgnoredWordssc Cs x|D]}|ioqnx|iD]} t} x}|D]u}|i |} | oY|i |o>|i |}x3|D] }|i |o t} qqWqt} PqAqAW| p<x9|D]-}|i |} | o|itqqWq.q.WqWdS(N(RRR>RLRTRRSt neededlisttneedR"thasR)thas_keytgettm2tmR6tignlisttignRZ( RRcR\R)RbRdRRaR]RSRTR^((RtcheckIgnoredMarkss2   cCsxt|D]\}}|ioq nx|iD]\}}xu|i D]g}||joTxQ|dD]A}||i i jo"||djo|itqqqqWqSqSWq:Wq WdS(Ntwordlisttignore_ignore_pos(R RtwiRR>t checklisttitemstktignvRLRTtvRRWRZR6(RRiRmRhRRTRlRk((RtcheckIgnoredWithMarks      *cCsd}xt|D]s\}}|ip"|idp|d}qNn|ido(|djo|idG|GHqqqWdS(Nis@NEGis@FMVis fmv taga (tposR RRhRR>R"RP(RRRoRh((RtcheckFmvPositions    cCsd}xNt|D]@\}}|ip'|ido |}qnd}qqW|djo%|i odG|GH|indS(Nis@PRDisPRD not in end ( RoR RRhRR>R"R0RP(RRRoRh((RtcheckPrdPositions   cCst}xDt|D]6\}}|idp|ido t}qqW|p(|ipdG|GH|i q|ndS(Ns@FCVs@FMVsFCV or FMV not found ( RRSR RRhRR"R6R0RP(RRhRRS((Rt checkFcvFmvs    (R R RRRRR&R#RERRORPR0RXR[ReRnRpRqRr(((RR s"     P  &      tWordcBs\tZdZdZdZdZdZdZdZdZ dd Z RS( NcCs||_t|_g|_dS(N(RRtwordRtignoredtinf(RR((RR s  cCs4|io d}nd}d||i|ifS(Nt1t0s %s %-20s %s(RR>tignfRtRv(RRy((RRs cCs|ii|dS(N(RRvR(RRv((RtaddInfoscCs|iS(N(RRv(R((RRLscCs*y|ii|dSWn dSnXdS(Nii(RRvtindexRN(RRN((RR=s cCs|iS(N(RRt(R((RR#scCs|iS(N(RRu(R((RR>&scCs$t|tpt||_dS(N(t isinstanceRdtbooltAssertionErrorRRu(RRd((RRZ)scCst}x)|iD]}||jo t}PqqW|o{|ot|i|o`t}xB|i |D]1}x(|iD]}||jo t}qvqvWqfW|o t}qqn|S(N( RRSRRvR!tmarkR6R)R_tis_in_skip_listR`tsm(RRR)RR!RRS((RR"-s$     ( R R RRRzRLR=RR>RZR2R"(((RRs s        t RulesItercBstZdZdZRS(NcCs||_d|_dS(Ni(RRtc(RR((RR@s cCsd|id|_|it|iijo tn|ii|i|ii|ii|igS(Ni(RRRRt_ridsR t_rules(R((RR Ds (R R RR (((RR>s t RulesListcBs8tZdZdZdZdZddZRS(NcCsh|_h|_g|_x(|D] }|ii|idq"W||_h|_ x3|D]+}||id|i |id]siiisTotal rule instances matched( RRRjRNtsortR6ttotalRtstrtljustRR(RRNRR((Rt printStatsZs6cCs |i|S(N(RRRD(RRD((RR`dsicCsW|ii|pd|i|