Class h.l.HDocument(object):
Part of hypy.libView In Hierarchy
Known subclasses: hypy.lib.HHit
Dict-like interface to a document >>> doc = HDocument(u'http://sample.com/page.html')
| Method | __str__ | Undocumented |
| Method | __init__ | Undocumented |
| Method | addHiddenText | Add text that will affect search scoring but will NOT appear in the |
| Method | addText | Put some text into the document |
| Class Method | fromCDocument | Construct a document from an existing estraiernative.Document, such as |
| Method | __delitem__ | Undocumented |
| Method | __setitem__ | Undocumented |
| Method | __getitem__ | Undocumented |
| Method | update | Update attributes of this document from another one |
| Method | get | Return doc[key] unless key is not found, in which case return the |
| Method | keys | Names of all attributes set on this document |
| Method | values | Values of all attributes set on this document |
| Method | items | (attribute_name, attribute_value) 2-tuples for every attribute in this |
| Method | getTexts | Return all (visible) texts in this document, as a list |
| Method | encode | Return an encoded version of this document. Convenience method |
| Method | _get_text | Undocumented |
| Method | _get_id | Undocumented |
@unicodeToByte((1, 'text'), TypeError)
def addHiddenText(self, text):
def addHiddenText(self, text):
Add text that will affect search scoring but will NOT appear in the output document
@classmethod
def fromCDocument(cls, cdocument):
def fromCDocument(cls, cdocument):
Construct a document from an existing estraiernative.Document, such as when iterating search results.
def
get(self, key, default=None):
Return doc[key] unless key is not found, in which case return the value of 'default' (None unless specified)