Ada.Matchers.BoWPoS.PosTagger.TagCodeBlocks C# (CSharp) Method

TagCodeBlocks() private method

private TagCodeBlocks ( string body ) : string
body string
return string
        private string TagCodeBlocks(string body)
        {
            var tagged = body;
            var m = codeBlock.Match(tagged);

            while (m.Success)
            {
                var code = tagged.Substring(m.Index, m.Length);
                var lines = code.Split('\n');

                tagged = tagged.Remove(m.Index, m.Length);

                if (lines.Length < 4)
                {
                    tagged = tagged.Insert(m.Index, " •CBS• ");
                }
                else if (lines.Length < 26)
                {
                    tagged = tagged.Insert(m.Index, " •CBM• ");
                }
                else
                {
                    tagged = tagged.Insert(m.Index, " •CBL• ");
                }

                m = codeBlock.Match(tagged);
            }

            return tagged;
        }