/// <summary>
        /// Разбор ответа сервера
        /// </summary>
        public static SearchTermInfo[] Parse
        (
            IEnumerable <string> answer
        )
        {
            List <SearchTermInfo> result = new List <SearchTermInfo>();

            Regex regex = new Regex(@"^(\d+)\#(.+)$");

            foreach (string line in answer)
            {
                Match match = regex.Match(line);
                if (match.Success)
                {
                    SearchTermInfo item = new SearchTermInfo
                    {
                        Count = int.Parse(match.Groups[1].Value),
                        Text  = match.Groups[2].Value
                    };
                    result.Add(item);
                }
            }

            return(result.ToArray());
        }
示例#2
0
 public TermLink[] GetTermLinks(SearchTermInfo term, int first, int limit)
 {
     return(InvertedFile.GetTermLinks(term, first, limit));
 }