|
HFST - Helsinki Finite-State Transducer Technology - C++ API
version 3.9.1
|
The stream is not in valid AT&T format. More...
#include <HfstExceptionDefs.h>
Additional Inherited Members | |
Public Member Functions inherited from HfstException | |
| HFSTDLL std::string | operator() (void) const |
| Get the error message. More... | |
The stream is not in valid AT&T format.
An example. The file "testfile.att" contains
0 1 a b
1
c
\verbatim
When we try to read it, an exception is thrown:
\verbatim
std::vector<HfstTransducer> transducers;
FILE * ifile = fopen("testfile.att", "rb");
try {
while (not eof(ifile))
{
HfstTransducer t(ifile, TROPICAL_OPENFST_TYPE, "epsilon");
transducers.push_back(t);
printf("read one transducer\n");
}
} catch (NotValidAttFormatException e) {
printf("Error reading transducer: not valid AT&T format.\n"); }
fclose(ifile);
fprintf(stderr, "Read %i transducers in total.\n", (int)transducers.size());
thrown by hfst::HfstTransducer::HfstTransducer(FILE*,ImplementationType,const std::string&)
1.8.7