mò )á¸Ec@sÖdZdkZdklZdklZlZlZdklZl Z dk l Z dk l Z dklZdklZlZdkZd klZd Zed „Zd „Zd efd„ƒYZd„ZdS(s?Abstract base class for full text index with relevance ranking.N(sIOBTree(sIIBTreesIIBuckets IITreeSet(s intersections difference(sLength(sIIndex(sWidCode(smass_weightedIntersectionsmass_weightedUnion(s Persistentf1024.0cCst||dƒS(Nf0.5(tinttftscale(RR((t=/data/zmath/zope/lib/python/Products/ZCTextIndex/BaseIndex.pyt scaled_int+scCst|ƒiƒS(s*Return a list of the unique elements in L.N(t IITreeSettLtkeys(R((Rtunique1st BaseIndexcBs¶tZeZd„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „Zd„Zd„ZdZd„Zd„Zd„ZRS(NcCsI||_tƒ|_tƒ|_tƒ|_tƒ|_ tƒ|_ dS(N( tlexicontselft_lexicontIOBTreet _wordinfotIIBTreet _docweightt _docwordstLengthtlengthtdocument_count(R R ((Rt__init__9s      cCs t|iƒS(s(Return the number of words in the index.N(tlenR R(R ((RRYscCs t|iƒS(s+Return the number of documents in the indexN(RR R(R ((RR^scCsti|i|ƒS(s/Return a list of the wordids for a given docid.N(tWidCodetdecodeR Rtdocid(R R((Rt get_wordscscCsÊ|ii|ƒo|i||ƒSn|ii|ƒ}|i |ƒ\}}|i ||ƒ||i |RR%t isinstancettypeRt DICT_CUTOFFRRR(R R5RRRV((RR7ïs , c CsÉthƒ}|ii}d}x”|iƒD]†\}}||ƒ}|djoh}|d7}n7t ||ƒo&t|ƒ|ijot|ƒ}n|||<||i|RWRRYRRRR%( R R!RRZR5RNR[R\RV((RR#s     & cCsJ|i|}||=|o||i|