internal string ToRomanNumber(List<string> alianNumber)
 {
     var romanNumber = "";
     alianNumber.ForEach(aNum =>
     {
         romanNumber += new AlianToRomanDictionary(Values).ToRomanNumber(aNum);
     });
     return romanNumber;
 }
Beispiel #2
0
 /// <summary>
 /// Calculate Credit values by translating creditStatements and using AlianNumberDictionary
 /// </summary>
 /// <param name="creditStatements"></param>
 /// <param name="alianNumberDictionary"></param>
 internal void CalculateCreditValues(List <string> creditStatements, Dictionary <string, string> alianNumberDictionary)
 {
     creditStatements.ForEach(item =>
     {
         List <string> parts = item.Split(' ').ToList();
         var romanNumber     = new AlianToRomanDictionary(alianNumberDictionary).ToRomanNumber(parts.Take(parts.Count - 4).ToList());
         var romanAmount     = new RomanNumber().Calculate(romanNumber);
         CreditValues.Add(parts[parts.Count - 4], (System.Convert.ToInt32(parts[parts.Count - 2]) / romanAmount).ToString());
     });
 }
Beispiel #3
0
 /// <summary>
 /// Calculate Credit values by translating creditStatements and using AlianNumberDictionary 
 /// </summary>
 /// <param name="creditStatements"></param>
 /// <param name="alianNumberDictionary"></param>
 internal void CalculateCreditValues(List<string> creditStatements,Dictionary<string,string> alianNumberDictionary)
 {
     creditStatements.ForEach(item =>
     {
         List<string> parts = item.Split(' ').ToList();
         var romanNumber = new AlianToRomanDictionary(alianNumberDictionary).ToRomanNumber(parts.Take(parts.Count - 4).ToList());
         var romanAmount = new RomanNumber().Calculate(romanNumber);
         CreditValues.Add(parts[parts.Count-4], (System.Convert.ToInt32(parts[parts.Count - 2]) / romanAmount).ToString());
     });
 }
Beispiel #4
0
        internal string ToRomanNumber(List <string> alianNumber)
        {
            var romanNumber = "";

            alianNumber.ForEach(aNum =>
            {
                romanNumber += new AlianToRomanDictionary(Values).ToRomanNumber(aNum);
            });
            return(romanNumber);
        }
Beispiel #5
0
 /// <summary>
 /// creates an instance of AlianToRomanDictionary, making sure using a constractor 
 /// which does not renew AlianToRomanDictionary().Values by using another instance which renews it
 /// by doing this we ensure that in each translation exactly one dictionary is created 
 /// create an instance of credit
 /// </summary>
 public Translator()
 {
     alianToRomanDictionary = new AlianToRomanDictionary(new AlianToRomanDictionary().Values);
     credit = new Credit();
 }
Beispiel #6
0
 /// <summary>
 /// creates an instance of AlianToRomanDictionary, making sure using a constractor
 /// which does not renew AlianToRomanDictionary().Values by using another instance which renews it
 /// by doing this we ensure that in each translation exactly one dictionary is created
 /// create an instance of credit
 /// </summary>
 public Translator()
 {
     alianToRomanDictionary = new AlianToRomanDictionary(new AlianToRomanDictionary().Values);
     credit = new Credit();
 }