-
Notifications
You must be signed in to change notification settings - Fork 1
HfstInputStream
A stream for reading HFST binary transducers.
An example:
istr = hfst.HfstInputStream('testfile1.hfst')
transducers = []
while not (istr.is_eof()):
transducers.append(istr.read())
istr.close()
print("Read %i transducers in total." % len(transducers))
For documentation on the HFST binary transducer format, see here. class HfstInputStream:
Create a stream for reading binary transducers. @param filename The name of the transducer file. If not given, standard input is used.
@throws StreamNotReadableException @throws NotTransducerStreamException @throws EndOfStreamException @throws TransducerHeaderException
istr_to_stdin = hfst.HfstInputStream()
istr_to_file = hfst.HfstInputStream(filename='transducer.hfst')
Close the stream.
If the stream points to standard input, nothing is done.
Whether the stream is at end.
Whether badbit is set.
Whether the state of the stream is good for input operations.
The type of the first transducer in the stream.
By default, all transducers in a stream have the same type, else a TransducerTypeMismatchException is thrown when reading the first transducer that has a different type than the previous ones.
Return next transducer.
@throws EndOfStreamException
Package hfst
- AttReader
- PrologReader
- HfstBasicTransducer
- HfstBasicTransition
- HfstTransducer
- HfstInputStream
- HfstOutputStream
- MultiCharSymbolTrie
- HfstTokenizer
- LexcCompiler
- XreCompiler
- PmatchContainer
- ImplementationType