Sample text parser using a finite state machine