HFST - Helsinki Finite-State Transducer Technology - C++ API  version 3.9.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members
NotValidAttFormatException Struct Reference

The stream is not in valid AT&T format. More...

#include <HfstExceptionDefs.h>

Inheritance diagram for NotValidAttFormatException:

Additional Inherited Members

- Public Member Functions inherited from HfstException
HFSTDLL std::string operator() (void) const
 Get the error message. More...

Detailed Description

The stream is not in valid AT&T format.

An example. The file "testfile.att" contains

0       1       a      b

When we try to read it, an exception is thrown:

std::vector<HfstTransducer> transducers;
FILE * ifile = fopen("testfile.att", "rb");
try {
  while (not eof(ifile))
    HfstTransducer t(ifile, TROPICAL_OPENFST_TYPE, "epsilon");
    printf("read one transducer\n");
} catch (NotValidAttFormatException e) {
    printf("Error reading transducer: not valid AT&T format.\n"); }
fprintf(stderr, "Read %i transducers in total.\n", (int)transducers.size());
thrown by 
hfst::HfstTransducer::HfstTransducer(FILE*,ImplementationType,const std::string&)

The documentation for this struct was generated from the following file: