Exemplo n.º 1
0
        public RomanConverter()
        {
            //Use a factory to create these rules
            toDecimalRules = RomanToDecimalFactory.GetRules();

            //Initialize toDecimalMapper
            romanToDecimalMapper = new Dictionary <string, int>();
            romanToDecimalMapper.Add("I", 1);
            romanToDecimalMapper.Add("V", 5);
            romanToDecimalMapper.Add("X", 10);
            romanToDecimalMapper.Add("L", 50);
            romanToDecimalMapper.Add("C", 100);
            romanToDecimalMapper.Add("D", 500);
            romanToDecimalMapper.Add("M", 1000);
        }
 public ExpressionParser(AliasMapper aliasMap, IDecimalConverter converter, CommodityIndex commodityIndex)
 {
     helper      = new ExpressionValidationHelper(aliasMap, commodityIndex);
     expressions = RomanToDecimalFactory.GetExpressions(aliasMap, converter, commodityIndex, helper);
 }