class TimitCorpusReader(CorpusReader): (source)
Constructor: TimitCorpusReader(root, encoding)
Reader for the TIMIT corpus (or any other corpus with the same file layout and use of file formats). The corpus root directory should contain the following files:
- timitdic.txt: dictionary of standard transcriptions
- spkrinfo.txt: table of speaker information
In addition, the root directory should contain one subdirectory for each speaker, containing three files for each utterance:
- <utterance-id>.txt: text content of utterances
- <utterance-id>.wrd: tokenized text content of utterances
- <utterance-id>.phn: phonetic transcription of utterances
- <utterance-id>.wav: utterance sound file
Method | __init__ |
Construct a new TIMIT corpus reader in the given directory. :param root: The root directory for this corpus. |
Method | audiodata |
Undocumented |
Method | fileids |
Return a list of file identifiers for the files that make up this corpus. |
Method | phone |
offset is represented as a number of 16kHz samples! |
Method | phone |
Undocumented |
Method | phones |
Undocumented |
Method | play |
Play the given audio sample. |
Method | sent |
Undocumented |
Method | sentid |
Undocumented |
Method | sents |
Undocumented |
Method | spkrid |
Undocumented |
Method | spkrinfo |
No summary |
Method | spkrutteranceids |
speaker. |
Method | transcription |
each word. |
Method | utterance |
Undocumented |
Method | utteranceids |
utterances in this corpus, or for the given speaker, dialect region, gender, sentence type, or sentence number, if specified. |
Method | wav |
Undocumented |
Method | word |
Undocumented |
Method | words |
Undocumented |
Instance Variable | speakers |
Undocumented |
Method | _utterance |
Undocumented |
Constant | _FILE |
A regexp matching fileids that are used by this corpus reader. |
Constant | _UTTERANCE |
Undocumented |
Instance Variable | _root |
The root directory for this corpus. |
Instance Variable | _speakerinfo |
Undocumented |
Instance Variable | _utterances |
A list of the utterance identifiers for all utterances in this corpus. |
Inherited from CorpusReader
:
Method | __repr__ |
Undocumented |
Method | abspath |
Return the absolute path for the given file. |
Method | abspaths |
Return a list of the absolute paths for all fileids in this corpus; or for the given list of fileids, if specified. |
Method | citation |
Return the contents of the corpus citation.bib file, if it exists. |
Method | encoding |
Return the unicode encoding for the given corpus file, if known. If the encoding is unknown, or if the given file should be processed using byte strings (str), then return None. |
Method | ensure |
Load this corpus (if it has not already been loaded). This is used by LazyCorpusLoader as a simple method that can be used to make sure a corpus is loaded -- e.g., in case a user wants to do help(some_corpus). |
Method | license |
Return the contents of the corpus LICENSE file, if it exists. |
Method | open |
Return an open stream that can be used to read the given file. If the file's encoding is not None, then the stream will automatically decode the file's contents into unicode. |
Method | readme |
Return the contents of the corpus README file, if it exists. |
Class Variable | root |
Undocumented |
Method | _get |
Undocumented |
Instance Variable | _encoding |
The default unicode encoding for the fileids that make up this corpus. If encoding is None, then the file contents are processed using byte strings. |
Instance Variable | _fileids |
A list of the relative paths for the fileids that make up this corpus. |
Instance Variable | _tagset |
Undocumented |
nltk.corpus.reader.CorpusReader.__init__
Construct a new TIMIT corpus reader in the given directory. :param root: The root directory for this corpus.
nltk.corpus.reader.CorpusReader.fileids
Return a list of file identifiers for the files that make up this corpus.
Parameters | |
filetype | If specified, then filetype indicates that only the files that have the given type should be returned. Accepted values are: txt, wrd, phn, wav, or metadata, |
Play the given audio sample.
Parameters | |
utterance | The utterance id of the sample to play |
start | Undocumented |
end | Undocumented |
utterances in this corpus, or for the given speaker, dialect region, gender, sentence type, or sentence number, if specified.
Returns | |
A list of the utterance identifiers for all |
A regexp matching fileids that are used by this corpus reader.
Value |
|