In file ../include/EST_Token.h:

class EST_Token

This class is similar to EST_String but also maintains the original punctuation and whitespace found around the token.

Public Methods

[more] EST_Token ()
[more] EST_Token (const EST_String p)
[more]void init ()
[more] Basic access to fields

[more]void set_token (const EST_String &p)
set token from a string
[more]void set_token (const char* p)
[more]void set_whitespace (const EST_String &p)
set whitespace of token
[more]void set_whitespace (const char* p)
[more]void set_punctuation (const EST_String &p)
set (post) punctuation of token
[more]void set_punctuation (const char* p)
[more]void set_prepunctuation (const EST_String &p)
set prepunction
[more]void set_prepunctuation (const char* p)
[more]const EST_String& whitespace ()
[more]const EST_String& punctuation ()
[more]const EST_String& prepunctuation ()
[more] Access token as a string

[more]const EST_String& S () const
Access token as a string
[more]const EST_String& String () const
Access token as a string
[more] operator EST_String () const
For automatic coercion to EST_String

[more] Access token as a int
[more] Access token as a long
[more] Access token as a float
[more] Access token as a double

[more]void set_row (int r)
[more]void set_col (int c)
[more]void set_filepos (int c)
Set file position in original EST_TokenStream
[more]EST_String lstring ()
Return lower case version of token name
[more]EST_String ustring ()
Return upper case version of token name
[more]int row (void) const
Line number in original EST_TokenStream
[more]int col (void) const
Line position in original EST_TokenStream
[more]int filepos (void) const
file position in original EST_TokenStream
[more]const EST_String pos_description () const
A string describing current position, suitable for error messages
[more]EST_Token& operator = (const EST_Token &a)
[more]EST_Token& operator = (const EST_String &a)
[more]int operator == (const EST_String &a)
[more]int operator != (const EST_String &a)
[more]int operator == (const char* a)
[more]int operator != (const char* a)

Public

[more]


Documentation

This class is similar to EST_String but also maintains the original punctuation and whitespace found around the token.

EST_Token's primary use is with EST_TokenStream class which allows easy tokenizing of ascii files.

A token consists of four parts, any of which may be empty: a name, the actual token, preceding whitespace, preceding punctuation, the name and succeeding punctuation.

o EST_Token()

o EST_Token(const EST_String p)

ovoid init()

o Basic access to fields

ovoid set_token(const EST_String &p)
set token from a string

ovoid set_token(const char* p)

ovoid set_whitespace(const EST_String &p)
set whitespace of token

ovoid set_whitespace(const char* p)

ovoid set_punctuation(const EST_String &p)
set (post) punctuation of token

ovoid set_punctuation(const char* p)

ovoid set_prepunctuation(const EST_String &p)
set prepunction

ovoid set_prepunctuation(const char* p)

oconst EST_String& whitespace()

oconst EST_String& punctuation()

oconst EST_String& prepunctuation()

o Access token as a string

oconst EST_String& S() const
Access token as a string

oconst EST_String& String() const
Access token as a string

o operator EST_String() const
For automatic coercion to EST_String

o Access token as a int

o Access token as a long

o Access token as a float

o Access token as a double

o

ovoid set_quoted(int q)
Note that this token was quoted (or not)

oint quoted() const
TRUE is token was quoted

ovoid set_row(int r)

ovoid set_col(int c)

ovoid set_filepos(int c)
Set file position in original EST_TokenStream

oEST_String lstring()
Return lower case version of token name

oEST_String ustring()
Return upper case version of token name

oint row(void) const
Line number in original EST_TokenStream

oint col(void) const
Line position in original EST_TokenStream

oint filepos(void) const
file position in original EST_TokenStream

oconst EST_String pos_description() const
A string describing current position, suitable for error messages

oEST_Token& operator = (const EST_Token &a)

oEST_Token& operator = (const EST_String &a)

oint operator == (const EST_String &a)

oint operator != (const EST_String &a)

oint operator == (const char* a)

oint operator != (const char* a)


This class has no child classes.
Friends:
ostream& operator << (ostream& s, const EST_Token &p)
Author:
Alan W Black (awb@cstr.ed.ac.uk): April 1996

Alphabetic index HTML hierarchy of classes or Java


This page is part of the Edinburgh Speech Tools Library documentation
Copyright University of Edinburgh 1997
Contact: speech_tools@cstr.ed.ac.uk