Commits

Matt Chaput  committed 0952e7b

Fixed some Sphinx/docstring issues.

  • Participants
  • Parent commits f1460c5
  • Branches 2.4x

Comments (0)

Files changed (3)

File docs/source/searching.rst

 
     results = s.search_page(q, 1)
 
-The default page length is 10 hits. You can use the ``pagelen`` keyword argument
-to set a different page length::
+The default page length is 10 hits. You can use the ``pagelen`` keyword
+argument to set a different page length::
 
     results = s.search_page(q, 5, pagelen=20)
 
 >>> results[0:2]
 [{"title": u"Hello World in Python", "path": u"/a/b/c"}, {"title": u"Foo", "path": u"/bar"}]
 
-By default, ``Searcher.search(myquery)`` limits the number of hits to 20, So
-the number of scored hits in the ``Results`` object may be less than the number
-of matching documents in the index.
+By default, ``Searcher.search(myquery)`` limits the number of hits to 20, So the
+number of scored hits in the ``Results`` object may be less than the number of
+matching documents in the index.
 
 >>> # How many documents in the entire index would have matched?
 >>> len(results)
 Calling ``len(Results)`` runs a fast (unscored) version of the query again to
 figure out the total number of matching documents. This is usually very fast
 but for large indexes it can cause a noticeable delay. If you want to avoid
-this dalay on very large indexes, you can use the
+this delay on very large indexes, you can use the
 :meth:`~whoosh.searching.Results.has_exact_length`,
-:meth:`~whoosh.searching.Results.estimated_length`,
-and :meth:`~whoosh.searching.Results.estimated_min_length` methods to estimate
-the number of matching documents without calling ``len()``::
+:meth:`~whoosh.searching.Results.estimated_length`, and
+:meth:`~whoosh.searching.Results.estimated_min_length` methods to estimate the
+number of matching documents without calling ``len()``::
 
     found = results.scored_length()
     if results.has_exact_length():
 
 For example, you might have a "best bet" field. This field contains hand-picked
 keywords for documents. When the user searches for those keywords, you want
-those documents to be placed at the top of the results list. You could try to do
-this by boosting the "bestbet" field tremendously, but that can have
-unpredictable effects on scoring. It's much easier to simply run the query twice
-and combine the results::
+those documents to be placed at the top of the results list. You could try to
+do this by boosting the "bestbet" field tremendously, but that can have
+unpredictable effects on scoring. It's much easier to simply run the query
+twice and combine the results::
 
     # Parse the user query
     userquery = queryparser.parse(querystring)
     Removes the documents in 'results' from the list of result documents.
 
 ``Results.upgrade(results)``
-    Any result documents that also appear in 'results' are moved to the top of
-    the list of result documents.
+    Any result documents that also appear in 'results' are moved to the top
+    of the list of result documents.
 
 ``Results.upgrade_and_extend(results)``
-    Any result documents that also appear in 'results' are moved to the top of
-    the list of result documents. Then any other documents in 'results' are
+    Any result documents that also appear in 'results' are moved to the top
+    of the list of result documents. Then any other documents in 'results' are
     added on to the list of result documents.
 
 

File src/whoosh/codec/base.py

 
     def doc_count_all(self):
         """
-        :returns: the total number of documents, DELETED OR UNDELETED, in this
-            segment.
+        Returns the total number of documents, DELETED OR UNDELETED, in this
+        segment.
         """
 
         raise NotImplementedError
 
     def doc_count(self):
         """
-        :returns: the number of (undeleted) documents in this segment.
+        Returns the number of (undeleted) documents in this segment.
         """
 
         raise NotImplementedError
 
     def has_deletions(self):
         """
-        :returns: True if any documents in this segment are deleted.
+        Returns True if any documents in this segment are deleted.
         """
 
         raise NotImplementedError
 
     def deleted_count(self):
         """
-        :returns: the total number of deleted documents in this segment.
+        Returns the total number of deleted documents in this segment.
         """
 
         raise NotImplementedError
         raise NotImplementedError
 
     def is_deleted(self, docnum):
-        """:returns: True if the given document number is deleted."""
+        """
+        Returns True if the given document number is deleted.
+        """
 
         raise NotImplementedError
 

File src/whoosh/support/dawg.py

 
 
 class Arc(object):
-    """Represents a directed arc between two nodes in an FSA/FST graph.
+    """
+    Represents a directed arc between two nodes in an FSA/FST graph.
     
     The ``lastarc`` attribute is True if this is the last outgoing arc from the
     previous node.
     def __init__(self, label=None, target=None, value=None, accept=False,
                  acceptval=None):
         """
-        :param label:The label bytes for this arc. For a word graph, this will
+        :param label: The label bytes for this arc. For a word graph, this will
             be a character.
         :param target: The address of the node at the endpoint of this arc.
         :param value: The inner FST value at the endpoint of this arc.
         :param accept: Whether the endpoint of this arc is an accept state
-            (eg the end of a valid word).
+            (e.g. the end of a valid word).
         :param acceptval: If the endpoint of this arc is an accept state, the
             final FST value for that accepted state.
         """