コード例 #1
0
ファイル: SentenceIndex.cs プロジェクト: Ogonik/LWS
        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;
            }
        }
コード例 #2
0
ファイル: SentenceIndex.cs プロジェクト: Ogonik/LWS
 public static string ToLogString(IndexInfoSentenceType value)
 {
     switch (value.Value)
     {
         case "1": return "Simple";
         case "2": return "Composite";
         default: return "Undefined";
     }
 }