Exemplo n.º 1
0
        /// <summary>
        /// Create a dictionary which has the mapping for ambiguous/unambiguous characters
        /// </summary>
        /// <summary>
        /// Find the list of characters that maps to the inputs symbol and applies the pattern rule.
        /// </summary>
        /// <param name="symbol">Character which has to be mapped.</param>
        private char[] MapSymbol(char symbol)
        {
            if (_alphabets.Contains(symbol))
            {
                return(new char[] { symbol });
            }

            switch (symbol)
            {
            case LeftAngle:
            case RightAngle:
            case Repeater:
                return(new char[] { symbol });

            default:
                break;
            }

            return(_alphabetSet.GetBasicSymbols(_alphabetSet.LookupBySymbol(symbol)).Select(c => c.Symbol).ToArray());
        }