BlogEngine.Core/Providers/XmlProvider/StopWords.cs

(完整代码) 1KB

#region Using

using System;
using System.Xml;
using System.IO;
using System.Collections.Generic;
using System.Collections.Specialized;
using BlogEngine.Core;

#endregion

namespace BlogEngine.Core.Providers
{
	/// <summary>
	/// A storage provider for BlogEngine that uses XML files.
	/// <remarks>
	/// To build another provider, you can just copy and modify
	/// this one. Then add it to the web.config's BlogEngine section.
	/// </remarks>
	/// </summary>
	public partial class XmlBlogProvider : BlogProvider
	{

		/// <summary>
		/// Loads the stop words used in the search feature.
		/// </summary>
		/// <returns></returns>
		public override StringCollection LoadStopWords()
		{
			string fileName = _Folder + "stopwords.txt";
			if (!File.Exists(fileName))
				return new StringCollection();

			using (StreamReader reader = new StreamReader(fileName))
			{
				string file = reader.ReadToEnd();
				string[] words = file.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);

				StringCollection col = new StringCollection();
				col.AddRange(words);

				return col;
			}

		}
	}
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。