Callbacks for various events in the library can be supported to provide more flexibility to users. Eg. callback for begin, sentence end, loop end etc