This function builds the TF table which represents Finite Automata for a given pattern
function computeTF ( pat , M , TF ) { let state , x ; for ( state = 0 ; state <= M ; ++ state ) for ( x = 0 ; x < NO_OF_CHARS ; ++ x ) TF [ state ] [ x ] = getNextState ( pat , M , state , x ) ; }