예제 #1
0
파일: StdMAnlys.cs 프로젝트: iwaag/AGBLang
        bool BlockReader.ReadBlock(string text, int startIndex, out int nextIndex, out Morpheme product)
        {
            nextIndex = startIndex;
            product   = null;
            int i = startIndex;

            if (MarkerBlockReader.CheckMarker(text, leftMarker, i, out i))
            {
                int firstContentIndex = i;
                int lastContentIndex  = i;
                while (i < text.Length)
                {
                    if (MarkerBlockReader.CheckMarker(text, rightMarker, i, out i))
                    {
                        nextIndex = i;
                        product   = new Morpheme {
                            id = formatID, word = text.Substring(firstContentIndex, lastContentIndex - firstContentIndex)
                        };
                        return(true);
                    }
                    lastContentIndex = ++i;
                }
            }
            return(false);
        }
예제 #2
0
파일: StdMAnlys.cs 프로젝트: iwaag/AGBLang
 bool BlockReader.ReadBlock(string text, int startIndex, out int nextIndex, out Morpheme product)
 {
     nextIndex = startIndex;
     product   = null;
     foreach (var marker in markers)
     {
         if (MarkerBlockReader.CheckMarker(text, marker, startIndex, out nextIndex))
         {
             return(true);
         }
     }
     return(false);
 }