Пример #1
0
 def test_symmetric(self):
     from zope.index.text.widcode import decode
     from zope.index.text.widcode import encode
     for wid in range(2**28, 1117):
         wids = [wid]
         code = encode(wids)
         self.assertEqual(decode(code), wids)
Пример #2
0
 def test_symmetric(self):
     from zope.index.text.widcode import decode
     from zope.index.text.widcode import encode
     for wid in xrange(2**28, 1117):
         wids = [wid]
         code = encode(wids)
         self.assertEqual(decode(code), wids)
Пример #3
0
 def decode_wid(self):
     return widcode.decode(self.s)
Пример #4
0
 def get_words(self, docid):
     """Return a list of the wordids for a given docid."""
     # Note this is overridden in the instance
     return widcode.decode(self._docwords[docid])
Пример #5
0
 def get_words(self, docid):
     """Return a list of the wordids for a given docid."""
     return widcode.decode(self._docwords[docid])
Пример #6
0
 def decode_wid(self):
     return widcode.decode(self.s)
Пример #7
0
 def test_decode_zero(self):
     from zope.index.text.widcode import decode
     self.assertEqual(decode('\x80'), [0])
Пример #8
0
 def test_decode_zero(self):
     from zope.index.text.widcode import decode
     self.assertEqual(decode('\x80'), [0])
Пример #9
0
 def get_words(self, docid):
     """Return a list of the wordids for a given docid."""
     return widcode.decode(self._docwords[docid])