コード例 #1
0
        private string GetContentText(ContentManagerContentResult content)
        {
            var text = content.Contents.FirstOrDefault().ContentText;

            if (string.IsNullOrEmpty(text))
            {
                return(text);
            }
            text = Regex.Replace(text, "[\n\r]+", " ", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
            text = Regex.Replace(text, "\\s+", " ", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
            return(text);
        }
コード例 #2
0
 private string ExtractAnswer(ContentManagerContentResult content)
 {
     //Status = 0 -> ExactMatch
     return(content.Status == 0 ? GetContentText(content) : "NotMatch");
 }