(self)
Returns a list of :class:`~whoosh.query.spans.Span` objects for the
        matches in this document. Raises an exception if the field being
        searched does not store positions.
Returns a list of :class:`~whoosh.query.spans.Span` objects for the
        matches in this document. Raises an exception if the field being
        searched does not store positions.
Returns a list of : class : ~whoosh . query . spans . Span objects for the matches in this document . Raises an exception if the field being searched does not store positions .
def spans(self):
        """Returns a list of :class:`~whoosh.query.spans.Span` objects for the
        matches in this document. Raises an exception if the field being
        searched does not store positions.
        """

        from whoosh.query.spans import Span

        if self.supports("characters"):
            lst = []
            for pos, startchar, endchar in self.value_as("characters"):
                lst.append(Span(pos, startchar=startchar, endchar=endchar))

            return lst
            # return [Span(pos, startchar=startchar, endchar=endchar)
            #         for pos, startchar, endchar in self.value_as("characters")]
        elif self.supports("positions"):
            return [Span(pos) for pos in self.value_as("positions")]
        else:
            raise Exception("Field does not support spans")
def spans ( self ) : from whoosh . query . spans import Span if self . supports ( "characters" ) : lst = [ ] for pos , startchar , endchar in self . value_as ( "characters" ) : lst . append ( Span ( pos , startchar = startchar , endchar = endchar ) ) return lst # return [Span(pos, startchar=startchar, endchar=endchar) #         for pos, startchar, endchar in self.value_as("characters")] elif self . supports ( "positions" ) : return [ Span ( pos ) for pos in self . value_as ( "positions" ) ] else : raise Exception ( "Field does not support spans" )