Bayonne
|
A core class to support language translation services in Bayonne phrasebook. More...
#include <bayonne.h>
Public Member Functions | |
BayonneTranslator (const char *iso) | |
Create a translator instance for a specific language identifier. | |
virtual | ~BayonneTranslator () |
BayonneTranslator * | getNext () |
Get next translator. | |
virtual unsigned | digits (BayonneSession *sessiob, unsigned count, const char *string) |
Translate a simple set of digits to spoken speech. | |
virtual unsigned | spell (BayonneSession *session, unsigned count, const char *string) |
Spell out the string as individual letters. | |
virtual unsigned | sayorder (BayonneSession *session, unsigned count, const char *string) |
Translate an ordinal number (xxnth) to prompts. | |
virtual unsigned | number (BayonneSession *session, unsigned count, const char *string) |
Translate a number to spoken speech. | |
virtual unsigned | saynumber (BayonneSession *session, unsigned count, const char *string) |
Translate generic numbers to spoken speech. | |
virtual unsigned | saycount (BayonneSession *session, unsigned count, const char *string) |
Translate a counting number (integer) to spoken speech. | |
virtual unsigned | sayhour (BayonneSession *session, unsigned count, const char *string) |
Translate a string for time into short hours. | |
virtual unsigned | saytime (BayonneSession *session, unsigned count, const char *string) |
Translate a string for time into speech. | |
virtual unsigned | weekday (BayonneSession *session, unsigned count, const char *string) |
Translate a string with a date into the spoken weekday. | |
virtual unsigned | sayday (BayonneSession *session, unsigned count, const char *string) |
virtual unsigned | saydate (BayonneSession *session, unsigned count, const char *string) |
Translate a string with a date into a spoken date. | |
virtual unsigned | saybool (BayonneSession *session, unsigned count, const char *string) |
Translate a logical value and speak as yes/no. | |
virtual unsigned | phone (BayonneSession *session, unsigned count, const char *string) |
Translate and speak a phone number. | |
virtual unsigned | extension (BayonneSession *session, unsigned count, const char *string) |
Translate and speak a phone extension. | |
virtual const char * | speak (BayonneSession *session, Line *line=NULL) |
Translation dispatch, processes script and invokes other methods. | |
const char * | getId (void) |
Get the id string. | |
Static Public Member Functions | |
static BayonneTranslator * | get (const char *name) |
Find a translator for a given name/location. | |
static BayonneTranslator * | getFirst (void) |
Get first translator. | |
static BayonneTranslator * | loadTranslator (const char *iso) |
Load a named translator into memory for use. | |
Static Protected Member Functions | |
static const char * | getToken (BayonneSession *s, Line *l, unsigned *idx) |
static unsigned | addItem (BayonneSession *s, unsigned count, const char *text) |
static const char * | getLast (BayonneSession *s, unsigned count) |
Protected Attributes | |
BayonneTranslator * | next |
const char * | id |
Static Protected Attributes | |
static BayonneTranslator * | first |
A core class to support language translation services in Bayonne phrasebook.
ost::BayonneTranslator::BayonneTranslator | ( | const char * | iso | ) |
Create a translator instance for a specific language identifier.
Generally iso names will be sued. Sometimes iso sub-identifiers may be used for nation specific versions of phrasebook.
iso | name of language/locale. |
virtual ost::BayonneTranslator::~BayonneTranslator | ( | ) | [virtual] |
static unsigned ost::BayonneTranslator::addItem | ( | BayonneSession * | s, |
unsigned | count, | ||
const char * | text | ||
) | [static, protected] |
virtual unsigned ost::BayonneTranslator::digits | ( | BayonneSession * | sessiob, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Translate a simple set of digits to spoken speech.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
virtual unsigned ost::BayonneTranslator::extension | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Translate and speak a phone extension.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
static BayonneTranslator* ost::BayonneTranslator::get | ( | const char * | name | ) | [static] |
Find a translator for a given name/location.
iso | language/locale name of translator to find. |
static BayonneTranslator* ost::BayonneTranslator::getFirst | ( | void | ) | [inline, static] |
Get first translator.
const char* ost::BayonneTranslator::getId | ( | void | ) | [inline] |
Get the id string.
static const char* ost::BayonneTranslator::getLast | ( | BayonneSession * | s, |
unsigned | count | ||
) | [static, protected] |
BayonneTranslator* ost::BayonneTranslator::getNext | ( | ) | [inline] |
Get next translator.
static const char* ost::BayonneTranslator::getToken | ( | BayonneSession * | s, |
Line * | l, | ||
unsigned * | idx | ||
) | [static, protected] |
static BayonneTranslator* ost::BayonneTranslator::loadTranslator | ( | const char * | iso | ) | [static] |
Load a named translator into memory for use.
This is used by the fifo/script language command.
iso | module name to load. |
virtual unsigned ost::BayonneTranslator::number | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Translate a number to spoken speech.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
virtual unsigned ost::BayonneTranslator::phone | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Translate and speak a phone number.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
virtual unsigned ost::BayonneTranslator::saybool | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Translate a logical value and speak as yes/no.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
virtual unsigned ost::BayonneTranslator::saycount | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Translate a counting number (integer) to spoken speech.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
virtual unsigned ost::BayonneTranslator::saydate | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Translate a string with a date into a spoken date.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
virtual unsigned ost::BayonneTranslator::sayday | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
virtual unsigned ost::BayonneTranslator::sayhour | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Translate a string for time into short hours.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
virtual unsigned ost::BayonneTranslator::saynumber | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Translate generic numbers to spoken speech.
This is the one used by the &number rule.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
virtual unsigned ost::BayonneTranslator::sayorder | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Translate an ordinal number (xxnth) to prompts.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
virtual unsigned ost::BayonneTranslator::saytime | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Translate a string for time into speech.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
virtual const char* ost::BayonneTranslator::speak | ( | BayonneSession * | session, |
Line * | line = NULL |
||
) | [virtual] |
Translation dispatch, processes script and invokes other methods.
session | to process a command from. |
line | of compiled script to process. |
virtual unsigned ost::BayonneTranslator::spell | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Spell out the string as individual letters.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
virtual unsigned ost::BayonneTranslator::weekday | ( | BayonneSession * | session, |
unsigned | count, | ||
const char * | string | ||
) | [virtual] |
Translate a string with a date into the spoken weekday.
session | to save list of prompts. |
count | of current prompts used. |
string | to be processed. |
BayonneTranslator* ost::BayonneTranslator::first [static, protected] |
const char* ost::BayonneTranslator::id [protected] |
BayonneTranslator* ost::BayonneTranslator::next [protected] |