public function nextState( $currentState, $inputChar ) {
		$initialState = $currentState;
		while ( true ) {
			$transitions =& $this->yesTransitions[$currentState];
			if ( isset( $transitions[$inputChar] ) ) {
				$nextState = $transitions[$inputChar];
				// Avoid failure transitions next time.
				if ( $currentState !== $initialState ) {
					$this->yesTransitions[$initialState][$inputChar] = $nextState;
				}
				return $nextState;
			}
			if ( $currentState === 0 ) {
				return 0;
			}
			$currentState = $this->noTransitions[$currentState];
		}
		// Unreachable outside 'while'
	}