| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
StringSource
A description of the location of a string in a document. Each
StringSource consists of a document identifier, along with
information about the begin and end offsets of each character in the
string. These offsets are typically either byte offsets or character
offsets. (Note that for unicode strings, byte offsets and character
offsets are not the same thing.)
StringSource is an abstract base class. Two concrete
subclasses are used depending on the properties of the string whose
source is being described:
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
begin The document offset where the string begins. |
|||
|
docid An identifier (such as a filename) that specifies which document contains the string. |
|||
|
end The document offset where the string ends. |
|||
|
offsets A list of offsets specifying the location of each character in the document. |
|||
|
|||
|
Create a new
In both cases, the arguments must be specified as keyword arguments (not positional arguments).
|
Return a StringSource describing the location where the specified
character was found. In particular, if
|
Return a StringSource describing the location where the specified
substring was found. In particular, if
Note: This method is abstract. |
Return the length of the string described by this
Note: This method is abstract. |
|
|
|
|||
beginThe document offset where the string begins. (I.e., the offset of the first character in the string.)source.begin is always equal
to source.offsets[0].
|
endThe document offset where the string ends. (For character offsets, one plus the offset of the last character; for byte offsets, one plus the offset of the last byte that encodes the last character).source.end is always equal to
source.offsets[-1].
|
offsetsA list of offsets specifying the location of each character in the document. Theith character of the string begins at offset
offsets[i] and ends at offset offsets[i+1].
The length of the offsets list is one greater than the list
of the string described by this StringSource.
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Apr 11 14:39:51 2011 | http://epydoc.sourceforge.net |