class ZipFilePathPointer(PathPointer): (source)
Constructor: ZipFilePathPointer(zipfile, entry)
A path pointer that identifies a file contained within a zipfile, which can be accessed by reading that zipfile.
Method | __init__ |
Create a new path pointer pointing at the specified entry in the given zipfile. |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | file |
Return the size of the file pointed to by this path pointer, in bytes. |
Method | join |
Return a new path pointer formed by starting at the path identified by this pointer, and then following the relative path given by fileid. The path components of fileid should be separated by forward slashes, regardless of the underlying file system's path seperator character. |
Method | open |
Return a seekable read-only stream that can be used to read the contents of the file identified by this path pointer. |
Property | entry |
The name of the file within zipfile that this path pointer points to. |
Property | zipfile |
The zipfile.ZipFile object used to access the zip file containing the entry identified by this path pointer. |
Instance Variable | _entry |
Undocumented |
Instance Variable | _zipfile |
Undocumented |
Create a new path pointer pointing at the specified entry in the given zipfile.
does not contain the specified entry.
Raises | |
IOError | If the given zipfile does not exist, or if it |
nltk.data.PathPointer.file_size
Return the size of the file pointed to by this path pointer, in bytes.
Raises | |
IOError | If the path specified by this pointer does not contain a readable file. |
nltk.data.PathPointer.join
Return a new path pointer formed by starting at the path identified by this pointer, and then following the relative path given by fileid. The path components of fileid should be separated by forward slashes, regardless of the underlying file system's path seperator character.
nltk.data.PathPointer.open
Return a seekable read-only stream that can be used to read the contents of the file identified by this path pointer.
Raises | |
IOError | If the path specified by this pointer does not contain a readable file. |