The Toolkit uses the NonVerbal Behavior Generator (NVBG) to turn text into a nonverbal behavior schedule, including head movement and gestures. The NVBG is a rule-based system which runs the character sentence through a parser to obtain syntactic information and combines this with known, basic semantic information. This in turn triggers rules which add pieces of nonverbal behavior to an overall schedule, in the form of Behavior Markup Language (BML).
The easiest way to get familiar with nonverbal behavior generation is to use VHBuilder, which exposes some of the more basic rules for easy manipulation. See the documentation and tutorial movie for more information.
For a deeper dive into the NVBG rules, you can take a look at the following files in \data\nvbg-toolkit: