private IEnumerable <WordWithValue> GetMeldWords()
        {
            var transitions = new UnweightedSuitTransitionsCreator(_workingDirectory).Create().ToList();

            var meldWords    = new List <WordWithValue>();
            var baseLanguage = Enumerable.Repeat(Enumerable.Range(0, 5), 10).CartesianProduct();

            foreach (var word in baseLanguage)
            {
                var w       = word.ToList();
                var current = 0;
                foreach (var c in w)
                {
                    current = transitions[current + c];
                    if (current == -1)
                    {
                        break;
                    }
                }
                if (current != -1)
                {
                    meldWords.Add(new WordWithValue(w, current));
                }
            }
            return(meldWords);
        }
        public void SetLanguage()
        {
            var transitions = new UnweightedSuitTransitionsCreator(_workingDirectory).Create().ToList();

            var entryStates     = GetEntryStates(transitions);
            var concealedStates = GetConcealedStates(entryStates, transitions);

            var oldToNewTransitions = new Dictionary <int, int>();
            var orderedEntryStates  = entryStates.OrderBy(x => x);

            foreach (var entryState in orderedEntryStates)
            {
                oldToNewTransitions.Add(entryState, oldToNewTransitions.Count);
            }
            foreach (var state in concealedStates.Except(entryStates))
            {
                oldToNewTransitions.Add(state, oldToNewTransitions.Count);
            }
            _statesWithFinalValues.Clear();

            var concealedTransitions = CreateArray(concealedStates.Count * 5);

            foreach (var state in concealedStates)
            {
                foreach (var c in Enumerable.Range(0, 5))
                {
                    var next = transitions[state + c];
                    if (next == -1)
                    {
                        continue; // null transitions
                    }
                    if (oldToNewTransitions.ContainsKey(next))
                    {
                        concealedTransitions[oldToNewTransitions[state] * 5 + c] = oldToNewTransitions[next] * 5;
                        // normal transitions
                    }
                    else
                    {
                        _statesWithFinalValues.Add(oldToNewTransitions[state]);
                        concealedTransitions[oldToNewTransitions[state] * 5 + c] = next; // final values
                    }
                }
            }

            Transitions = concealedTransitions;
            EntryStates = entryStates.Select(e => oldToNewTransitions[e]).ToList();
        }