Exemple #1
0
        public SentenceIndex(string index)
        {
            if (index.Length != INDEX_CHAR_COUNT)
            {
                Program.log.ErrorFormat("Input sentence index is incorrect: contains less or more than {0} symbols: {1}", INDEX_CHAR_COUNT, index);
                index1Info = IndexInfoSentenceType.Undefined;
                index2Info = IndexInfoInserts.Undefined;
                index3Info = IndexInfoOneCan.Undefined;
                index4Info = IndexInfoParsingError.Undefined;

                info5Info = new IndexAppliedAlgorithms();
                info5Info.Value = "-1";
                info5Info.IsUndefined = true;
                info5Info.HasAppliedAlgorithms = false;
            }
            else
            {

                index1Info = IndexInfoSentenceType.ReadFromString(index[0].ToString());
                index2Info = IndexInfoInserts.ReadFromString(index[1].ToString());
                index3Info = IndexInfoOneCan.ReadFromString(index[2].ToString());
                index4Info = IndexInfoParsingError.ReadFromString(index[3].ToString());

                info5Info = new IndexAppliedAlgorithms();
                info5Info.Value = "0";
                info5Info.IsUndefined = false;
                info5Info.HasAppliedAlgorithms = false;
            }
        }
Exemple #2
0
 public static string ToLogString(IndexInfoParsingError value)
 {
     switch (value.Value)
     {
         case "0": return "Parsing  OK";
         case "4": return "ParsingError";
         default: return "Undefined";
     }
 }