ó ¥%zSc@sddlmZddlmZddlTddd„ƒYZddd„ƒYZddd „ƒYZd dd „ƒYZd dd „ƒYZ dS(iÿÿÿÿ(tetree(tdump(t*tCholdercBsAeZdd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs7d|_|dkr*tjdƒ|_n ||_dS(NsNAF/KAFtopinion_holder(ttypetNoneRtElementtnode(tselfR((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt__init__ s  cCs|jj|jƒƒdS(N(Rtappendtget_node(R tmy_span((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pytset_spanscCs2|jddƒ}|jjdtj|ƒƒdS(Ns--s- -i(treplaceRtinsertRtComment(R tc((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt set_commentscCs,|jjdƒ}|dk r(t|ƒSdS(Ntspan(RtfindRtCspan(R tspan_obj((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pytget_spans  cCs t|jƒS(N(RR(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt__str__scCs|jS(N(R(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR !sN( t__name__t __module__RR RRRRR (((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR s      tCtargetcBsJeZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(cCs7d|_|dkr*tjdƒ|_n ||_dS(NsNAF/KAFtopinion_target(RRRRR(R R((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR &s  cCs2|jddƒ}|jjdtj|ƒƒdS(Ns--s- -i(RRRRR(R R((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR-scCs|jS(N(t node_comment(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt get_comment1scCs|jj|jƒƒdS(N(RR R (R R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR4scCs,|jjdƒ}|dk r(t|ƒSdS(NR(RRRR(R R((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR7s  cCs t|jƒS(N(RR(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR=scCs|jS(N(R(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR @sN( RRRR RRRRRR (((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR%s      t CexpressioncBseeZd d„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z RS( cCs7d|_|dkr*tjdƒ|_n ||_dS(NsNAF/KAFtopinion_expression(RRRRR(R R((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR Es  cCs2|jddƒ}|jjdtj|ƒƒdS(Ns--s- -i(RRRRR(R R((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyRLscCs|jjd|ƒdS(Ntpolarity(Rtset(R tpol((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt set_polarityPscCs|jjdƒS(NR"(Rtget(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt get_polaritySscCs|jjd|ƒdS(Ntstrength(RR#(R tst((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt set_strengthVscCs|jjdƒS(NR((RR&(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt get_strengthYscCs|jj|jƒƒdS(N(RR R (R R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR\scCs,|jjdƒ}|dk r(t|ƒSdS(NR(RRRR(R R((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR_s  cCs t|jƒS(N(RR(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyRescCs|jS(N(R(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR hsN( RRRR RR%R'R*R+RRRR (((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR Ds         tCopinioncBszeZd dd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „ZRS(tNAFcCs7||_|dkr*tjdƒ|_n ||_dS(Ntopinion(RRRRR(R RR((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR ls  cCs2|jddƒ}|jjdtj|ƒƒdS(Ns--s- -i(RRRRR(R R((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyRsscCsN|jdkr%|jjd|ƒn%|jdkrJ|jjd|ƒndS(NR-tidtKAFtoid(RRR#(R tmy_id((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pytset_idwscCsB|jdkr|jjdƒS|jdkr>|jjdƒSdS(NR-R/R0R1(RRR&(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pytget_id}scCs|jj|jƒƒdS(N(RR R (R thol((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt set_holderƒscCs0|jjdƒ}|dk r(t|ƒSdSdS(NR(RRRR(R tnode_hol((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt get_holder†s  cCs|jj|jƒƒdS(N(RR R (R ttar((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt set_targetscCs0|jjdƒ}|dk r(t|ƒSdSdS(NR(RRRR(R t node_target((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt get_targets  cCs|jj|jƒƒdS(N(RR R (R texp((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pytset_expression—scCs0|jjdƒ}|dk r(t|ƒSdSdS(NR!(RRRR (R tnode_exp((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pytget_expressionšs  cCs t|jƒS(N(RR(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR¡scCs|jS(N(R(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR ¤sN(RRRR RR3R4R6R8R:R<R>R@RR (((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR,ks          t CopinionscBsVeZd dd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( R-cCs7||_|dkr*tjdƒ|_n ||_dS(Ntopinions(RRRRR(R RR((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR ¬s  ccs&x|jjdƒD] }|VqWdS(NR.(Rtfindall(R R((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt__get_opinion_nodes³sccs,x%|jƒD]}t||jƒVq WdS(N(t_Copinions__get_opinion_nodesR,R(R R((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt get_opinions·scCsP|jdkrLx:|jƒD])}|jd|jdƒƒ|jd=qWndS(NR-R1R/(RRER#R&tattrib(R R((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pytto_kaf»scCsP|jdkrLx:|jƒD])}|jd|jdƒƒ|jd=qWndS(NR0R/R1(RRER#R&RG(R R((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pytto_nafÁscCs|jj|jƒƒdS(N(RR R (R topi_obj((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyt add_opinionÈscCs|jS(N(R(R ((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyR ËscCsGx@|jƒD]2}|jƒ|kr |jj|jƒƒPq q WdS(N(RFR4RtremoveR (R t opinion_idtopi((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pytremove_this_opinionÎsN( RRRR RERFRHRIRKR RO(((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyRA«s      N(((((( tlxmlRtlxml.objectifyRt span_dataRRR R,RA(((s6/tmp/tmphMOK1S/lib/python/KafNafParser/opinion_data.pyts '@