public boolean hasNext() {
        //System.out.println("Token when calling hasNext(): " + token);
        if (priorMapDict.containsKey(token)) {
            int qiVal = priorMapDict.get(token).priorPolarity;
            while ((stateId < numStates) && ((qiVal <= 0 && stateId == 1) ||
                    (qiVal >= 0 && stateId == 2) || (qiVal != 0 && stateId == 3))) {
                stateId++;
            }
            return (stateId < numStates);
        } else {
            return false;
        }
    }