Home

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
MethodaddHiddenTextAdd text that will affect search scoring but will NOT appear in the
MethodaddTextPut some text into the document
Class MethodfromCDocumentConstruct a document from an existing estraiernative.Document, such as
Method__delitem__Undocumented
Method__setitem__Undocumented
Method__getitem__Undocumented
MethodupdateUpdate attributes of this document from another one
MethodgetReturn doc[key] unless key is not found, in which case return the
MethodkeysNames of all attributes set on this document
MethodvaluesValues of all attributes set on this document
Methoditems(attribute_name, attribute_value) 2-tuples for every attribute in this
MethodgetTextsReturn all (visible) texts in this document, as a list
MethodencodeReturn an encoded version of this document. Convenience method
Method_get_textUndocumented
Method_get_idUndocumented
def __str__(self):
Undocumented
@unicodeToByte((1, 'uri'), TypeError)
def __init__(self, uri):
Undocumented
@unicodeToByte((1, 'text'), TypeError)
def addHiddenText(self, text):
Add text that will affect search scoring but will NOT appear in the
output document
@unicodeToByte((1, 'text'), TypeError)
def addText(self, text):
Put some text into the document
@classmethod
def fromCDocument(cls, cdocument):
Construct a document from an existing estraiernative.Document, such as
when iterating search results.
def __delitem__(self, name):
Undocumented
@unicodeToByte((1, 'name')(2, 'value'), TypeError)
def __setitem__(self, name, value):
Undocumented
@unicodeToByte((1, 'name'), KeyError)
def __getitem__(self, name):
Undocumented
def update(self, other):
Update attributes of this document from another one
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)
def keys(self):
Names of all attributes set on this document
def values(self):
Values of all attributes set on this document
def items(self):
(attribute_name, attribute_value) 2-tuples for every attribute in this
document
def getTexts(self):
Return all (visible) texts in this document, as a list
def _get_text(self):
Undocumented
def _get_id(self):
Undocumented
def encode(self, encoding):
Return an encoded version of this document.  Convenience method
API Documentation for Hypy, generated by pydoctor at 2009-09-20 10:39:55.