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

A skeleton class for reading a new type of binary transducers from a stream. More...

#include <MyTransducerLibraryTransducer.h>

Public Member Functions

void close (void)
 Close the stream. If it points to standard in, nothing is done. More...
 
void ignore (unsigned int n)
 Extract n chars and ignore them. More...
 
bool is_bad (void)
 Whether the stream's badbit has been set. More...
 
bool is_eof (void)
 Whether the stream is at end. More...
 
bool is_fst (void)
 Whether the next object in the stream is a MyFst. More...
 
bool is_good (void)
 Whether the stream is good for input operations. More...
 
 MyTransducerLibraryInputStream (void)
 Create and open a stream to standard in. More...
 
 MyTransducerLibraryInputStream (const std::string &filename)
 Create and open a stream to file filename. More...
 
MyFst * read_transducer ()
 Read a MyFst from the stream. More...
 
bool set_implementation_specific_header_data (StringPairVector &data, unsigned int index)
 Optional: if you want to extract implementation specific data from the header. More...
 
char stream_get ()
 Extract a char from the stream. More...
 
void stream_unget (char c)
 Put back a char to the stream. More...
 

Detailed Description

A skeleton class for reading a new type of binary transducers from a stream.

If your transducer read function uses C FILEs, see class SfstInputStream or FomaInputStream for an example how to implement the functions in class MyTransducerLibraryInputStream. If your transducer read function uses C++ streams, see class TropicalWeightInputStream or LogWeightInputStream.

Constructor & Destructor Documentation

Create and open a stream to standard in.

MyTransducerLibraryInputStream ( const std::string &  filename)

Create and open a stream to file filename.

Member Function Documentation

void close ( void  )

Close the stream. If it points to standard in, nothing is done.

void ignore ( unsigned int  n)

Extract n chars and ignore them.

bool is_bad ( void  )

Whether the stream's badbit has been set.

bool is_eof ( void  )

Whether the stream is at end.

bool is_fst ( void  )

Whether the next object in the stream is a MyFst.

bool is_good ( void  )

Whether the stream is good for input operations.

MyFst * read_transducer ( )

Read a MyFst from the stream.

bool set_implementation_specific_header_data ( StringPairVector data,
unsigned int  index 
)

Optional: if you want to extract implementation specific data from the header.

char stream_get ( )

Extract a char from the stream.

void stream_unget ( char  c)

Put back a char to the stream.


The documentation for this class was generated from the following files: