class documentation

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_size 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.
@abstractmethod
def file_size(self): (source)

Return the size of the file pointed to by this path pointer, in bytes.

Raises
IOErrorIf the path specified by this pointer does not contain a readable file.
@abstractmethod
def join(self, fileid): (source)

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.

@abstractmethod
def open(self, encoding=None): (source)

Return a seekable read-only stream that can be used to read the contents of the file identified by this path pointer.

Raises
IOErrorIf the path specified by this pointer does not contain a readable file.