class PathPointer: (source)
Known subclasses: nltk.data.FileSystemPathPointer
, nltk.data.ZipFilePathPointer
An abstract base class for 'path pointers,' used by NLTK's data package to identify specific paths. Two subclasses exist: FileSystemPathPointer identifies a file that can be accessed directly via a given absolute path. ZipFilePathPointer identifies a file contained within a zipfile, that can be accessed by reading that zipfile.
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. |
nltk.data.FileSystemPathPointer
, nltk.data.ZipFilePathPointer
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.FileSystemPathPointer
, nltk.data.ZipFilePathPointer
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.FileSystemPathPointer
, nltk.data.ZipFilePathPointer
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. |