private void ExploreStates(IList <Edu.Stanford.Nlp.Fsm.DFSAState <T, S> > toVisit, ICollection <Edu.Stanford.Nlp.Fsm.DFSAState <T, S> > visited) { while (!toVisit.IsEmpty()) { Edu.Stanford.Nlp.Fsm.DFSAState <T, S> state = toVisit[toVisit.Count - 1]; toVisit.Remove(toVisit.Count - 1); if (!visited.Contains(state)) { Sharpen.Collections.AddAll(toVisit, state.SuccessorStates()); visited.Add(state); } } }
// equals public override bool Equals(object o) { if (this == o) { return(true); } if (!(o is Edu.Stanford.Nlp.Fsm.DFSAState)) { return(false); } Edu.Stanford.Nlp.Fsm.DFSAState s = (Edu.Stanford.Nlp.Fsm.DFSAState)o; // historically also checked: accepting == s.accepting && //inputToTransition.equals(s.inputToTransition)) return(dfsa.Equals(s.dfsa) && stateID.Equals(s.stateID)); }