class FileSystemPathPointer(PathPointer, str): (source)
Known subclasses: nltk.data.GzipFileSystemPathPointer
Constructor: FileSystemPathPointer(_path)
A path pointer that identifies a file which can be accessed directly via a given absolute path.
Method | __init__ |
Create a new path pointer for the given absolute path. |
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 | path |
The absolute path identified by this path pointer. |
Instance Variable | _path |
Undocumented |
Create a new path pointer for the given absolute path.
Raises | |
IOError | If the given path does not exist. |
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
nltk.data.GzipFileSystemPathPointer
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. |