Implement the silly sentence generation algorithm described on pages 392 to 396.
You should provide two different implementations of the algorithm: one using the map container from the C++ standard template library and another one using the hash_map container provided by the GNU C++ compiler.
The GNU hash_map container is implemented in header file <hash_map> or possibly header file <ext/hash_map>.
The hash_map container is defined in the namespace __gnu_cxx.
The GNU hash_map has the same interface as the hash_map container provided by Silicon Graphics Inc..
The hash_map class takes a hash function as a template parameter. If you omit the hash function, the class uses a default function class as a hash function. This default hash function class does not accept instances of the string class. However, it does take char pointers.
One solution to the char pointer problem is to convert strings to char pointers using the c_str function of the string class. The following code shows an example of this.
hash_map<const char *, const char *> map; string s = "PERSON"; map[s.c_str()] = "my sister";
An alternative is to write a function class that takes a string argument, converts it to a char pointer and calls the default hash function used by the system. Then, pass your function class as the third parameter when you instantiate the hash_map template class.