HFST - Helsinki Finite-State Transducer Technology API
version 3.7.1
|
A stream for writing binary transducers. More...
#include <HfstOutputStream.h>
Public Member Functions | |
void | close (void) |
Close the stream. More... | |
HfstOutputStream (ImplementationType type, bool hfst_format=true) | |
Create a stream to standard output for writing binary transducers of type type. hfst_format defines whether transducers are written in hfst format or as such in their backend format. More... | |
HfstOutputStream (const std::string &filename, ImplementationType type, bool hfst_format=true) | |
Open a stream to file filename for writing binary transducers of type type. hfst_format defines whether transducers are written in hfst format or as such in their backend format. More... | |
HfstOutputStream & | operator<< (HfstTransducer &transducer) |
Write the transducer transducer in binary format to the stream. More... | |
HfstOutputStream & | redirect (HfstTransducer &transducer) |
An alias for operator<<. More... | |
~HfstOutputStream (void) | |
Destructor. More... | |
A stream for writing binary transducers.
An example:
#include "HfstOutputStream.h" ... // Write three HFST transducers in binary format to file named "testfile" HfstOutputStream out("testfile", FOMA_TYPE); out << foma_transducer1 << foma_transducer2 << foma_transducer3; out.close();
For more information on HFST transducer structure, see this page.
HfstOutputStream | ( | ImplementationType | type, |
bool | hfst_format = true |
||
) |
Create a stream to standard output for writing binary transducers of type type. hfst_format defines whether transducers are written in hfst format or as such in their backend format.
HfstOutputStream | ( | const std::string & | filename, |
ImplementationType | type, | ||
bool | hfst_format = true |
||
) |
Open a stream to file filename for writing binary transducers of type type. hfst_format defines whether transducers are written in hfst format or as such in their backend format.
If the file exists, it is overwritten.
~HfstOutputStream | ( | void | ) |
Destructor.
void close | ( | void | ) |
Close the stream.
If the stream points to standard output, nothing is done.
HfstOutputStream & operator<< | ( | HfstTransducer & | transducer | ) |
Write the transducer transducer in binary format to the stream.
All transducers must have the same type as the stream, else a TransducerTypeMismatchException is thrown.
TransducerTypeMismatchException |
HfstOutputStream & redirect | ( | HfstTransducer & | transducer | ) |
An alias for operator<<.