コード例 #1
0
 private static string GetTermDefXml(Keyword keyword)
 {
     if (string.IsNullOrEmpty(keyword.Term) || string.IsNullOrEmpty(keyword.Definition))
     {
         return(string.Empty);
     }
     return(string.Format(
                "<SpecialTermInformation><Keyword>{0}</Keyword><Description>{1}</Description></SpecialTermInformation>",
                SPHttpUtility.HtmlEncode(keyword.Term), SPHttpUtility.HtmlEncode(keyword.Definition)));
 }
コード例 #2
0
        private static string BuildBestBetXml(Keyword keyword, BestBet bestBet)
        {
            return(string.Format(
                       @"
                                            <Result>
			<id>{0}</id>
			<title>{1}</title>
			<description>{2}</description>
			<url>{3}</url>
			<urlEncoded>{3}</urlEncoded>
			<teaserContentType/>
			<FS14Description/>
			<keyword>KD[{4}]</keyword>
		</Result>"        ,
                       1, SPHttpUtility.HtmlEncode(bestBet.Name), SPHttpUtility.HtmlEncode(bestBet.Description),
                       bestBet.Uri.OriginalString, SPHttpUtility.HtmlEncode(keyword.Term)));
        }
コード例 #3
0
        private static List <string> GetPartialTermAndSynonymWords(Keyword keyword)
        {
            List <string> individualTerms = new List <string>(10);

            if (!string.IsNullOrEmpty(keyword.Term))
            {
                AddSingleWordTerms(individualTerms, keyword.Term);
            }
            DateTime currentDate = DateTime.Now;

            foreach (Synonym synonym in keyword.Synonyms)
            {
                if (synonym.StartDate < currentDate || synonym.EndDate > currentDate)
                {
                    continue;
                }
                if (!string.IsNullOrEmpty(synonym.Term))
                {
                    AddSingleWordTerms(individualTerms, synonym.Term);
                }
            }
            return(individualTerms);
        }
コード例 #4
0
        private static List <string> GetFullTermAndSynonymWords(Keyword keyword)
        {
            List <string> terms = new List <string>(10);

            if (!string.IsNullOrEmpty(keyword.Term))
            {
                terms.Add(keyword.Term.ToLower());
            }
            DateTime currentDate = DateTime.Now;

            foreach (Synonym synonym in keyword.Synonyms)
            {
                if (synonym.StartDate < currentDate || synonym.EndDate > currentDate)
                {
                    continue;
                }
                if (!string.IsNullOrEmpty(synonym.Term))
                {
                    terms.Add(synonym.Term.ToLower());
                }
            }
            return(terms);
        }