Changeset 382
- Timestamp:
- 02/08/07 19:56:17 (2 years ago)
- Files:
-
- pyndexter/trunk/pyndexter/__init__.py (modified) (5 diffs)
- pyndexter/trunk/.todo (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pyndexter/trunk/pyndexter/__init__.py
r380 r382 595 595 """ Close the indexer. The object is subsequently not usable. 596 596 597 `sync()` is automatically called by the `Framework` prior to `close()`.""" 597 `flush()` is automatically called by the `Framework` prior to 598 `close()`.""" 598 599 raise NotImplementedError 599 600 … … 633 634 """ Optimise the indexer. """ 634 635 635 def sync(self):636 """ Synchronise indexer with stored representation."""636 def flush(self): 637 """Flush indexer state to disk.""" 637 638 638 639 def state_store(self): … … 875 876 """ Sync and close the indexer. The object is subsequently not 876 877 usable. """ 877 self. sync()878 self.flush() 878 879 self.indexer.close() 879 880 … … 882 883 self.indexer.optimise() 883 884 884 def sync(self):885 """ Synchronise indexer with on-disk representation."""885 def flush(self): 886 """Flush indexer state to disk.""" 886 887 if self.mode == READWRITE: 887 888 if self.mode == READWRITE and self.state_store: 888 889 store = self.state_store.store() 889 890 self.source.marshal(store) 890 self.indexer. sync()891 self.indexer.flush() 891 892 892 893 # Helper methods … … 1002 1003 1003 1004 class Excerpt(object): 1004 """Generate an excerpt of a Document.""" 1005 """Generate an excerpt of a Document. 1006 1007 Has three useful attributes: 1008 `current` whether this is a current copy of the `Document` (as 1009 opposed to a historical version from the `Indexer`) 1010 `quality` quality of the text compared to the original, between 0. 1011 and 1.0 1012 `text` the excerpt text 1013 1014 """ 1005 1015 def __init__(self, doc, terms, max_len=240, fuzz=60, current=True): 1006 1016 self.text = self._shorten(doc.content, terms, max_len, fuzz) pyndexter/trunk/.todo
r380 r382 69 69 Use metakit for pure-Python implementation? (Check out "divmod pyndex" for ideas) 70 70 </note> 71 <note priority="medium" time="1170604364" >71 <note priority="medium" time="1170604364" done="1170931795"> 72 72 Deprecate Hit and just use Document - they're almost identical in functionality. 73 <note priority="medium" time="1170812979"> 73 <comment> 74 Bad idea. Hit now has indexed and current members, which lazily fetch from the Indexer and Framework, respectively. 75 </comment> 76 <note priority="medium" time="1170812979" done="0"> 74 77 Perhaps Results should use the framework to try and fetch a Document, then "underlay" the hit attributes? 75 78 </note> 76 79 </note> 77 <note priority=" medium" time="1170651530">80 <note priority="high" time="1170651530"> 78 81 Add generalised "field" indexing. 79 82 </note>
