コード例 #1
0
        protected internal virtual ICollection <object> GetInverseImages(ExactAutomatonMinimizer.ExactBlock <TransducerGraph.Arc> block, object symbol)
        {
            IList <object> inverseImages = new List <object>();

            foreach (TransducerGraph.Arc member in block.GetMembers())
            {
                ICollection <TransducerGraph.Arc> arcs = null;
                if (member != SinkNode)
                {
                    arcs = GetUnminimizedFA().GetArcsByTargetAndInput(member, symbol);
                }
                else
                {
                    arcs = GetUnminimizedFA().GetArcsByInput(symbol);
                    if (!sparseMode)
                    {
                        arcs = Difference(GetUnminimizedFA().GetArcs(), arcs);
                    }
                }
                if (arcs == null)
                {
                    continue;
                }
                foreach (TransducerGraph.Arc arc in arcs)
                {
                    object source = arc.GetSourceNode();
                    inverseImages.Add(source);
                }
            }
            return(inverseImages);
        }
コード例 #2
0
 protected internal virtual void MakeBlock(ICollection <TransducerGraph.Arc> members)
 {
     ExactAutomatonMinimizer.ExactBlock <TransducerGraph.Arc> block = new ExactAutomatonMinimizer.ExactBlock <TransducerGraph.Arc>(Generics.NewHashSet(members));
     foreach (TransducerGraph.Arc member in block.GetMembers())
     {
         if (member != SinkNode)
         {
             memberToBlock[member] = block;
         }
     }
     foreach (object o in GetSymbols())
     {
         TransducerGraph.Arc symbol = (TransducerGraph.Arc)o;
         AddActivePair(new Pair <ExactAutomatonMinimizer.ExactBlock <TransducerGraph.Arc>, TransducerGraph.Arc>(block, symbol));
     }
 }