+ """A collection of searchable documents. The caller can
+ add documents to it (or edit existing docs) via :meth:`add_doc`,
+ retrieve a document given its docid via :meth:`get_doc`, and
+ perform various lookups of documents. The most interesting
+ lookup is implemented in :meth:`query`.
+
+ >>> c = Corpus()
+ >>> c.add_doc(Document(
+ ... docid=1,
+ ... tags=set(['urgent', 'important']),
+ ... properties=[
+ ... ('author', 'Scott'),
+ ... ('subject', 'your anniversary')
+ ... ],
+ ... reference=None,
+ ... )
+ ... )
+ >>> c.add_doc(Document(
+ ... docid=2,
+ ... tags=set(['important']),
+ ... properties=[
+ ... ('author', 'Joe'),
+ ... ('subject', 'your performance at work')
+ ... ],
+ ... reference=None,
+ ... )
+ ... )
+ >>> c.add_doc(Document(
+ ... docid=3,
+ ... tags=set(['urgent']),
+ ... properties=[
+ ... ('author', 'Scott'),
+ ... ('subject', 'car turning in front of you')
+ ... ],
+ ... reference=None,
+ ... )
+ ... )
+ >>> c.query('author:Scott and important')
+ {1}
+ >>> c.query('*')
+ {1, 2, 3}
+ >>> c.query('*:*')
+ {1, 2, 3}
+ >>> c.query('*:Scott')
+ {1, 3}
+ """