⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 word.cs

📁 本系统是在asp版《在线文件管理器》的基础上设计制作
💻 CS
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using CommunityServer.Components;

namespace CommunityServer.Components {

    public class Word {
        int occurrence = 0;
        int _occurenceWeight = 0;
        string word;

        public Word(string word, WordLocation location) {
            this.word = word;
            IncrementOccurence(location);
        }

        public void IncrementOccurence(WordLocation location) {

            //ScottW:
            //This may need to be Application specific since only blog has Excerpt. 
            //It should not break the search logic, but just a little messy to drop it
            //in here.
            switch(location)
            {
                case WordLocation.Section:
                        _occurenceWeight += 5;
                    break;
                case WordLocation.Excerpt:
                    _occurenceWeight += 5;
                    break;
                case WordLocation.Subject:
                    _occurenceWeight += 10;
                    break;
                default:
                    _occurenceWeight++;
                    break;

            }
        }

        public string Name {
            get {
                return word;
            }
        }

        public int OccurenceWeight {
            get {
                return _occurenceWeight;
            }
        }

        public int Occurence {
            get {
                return occurrence;
            }
        }

        private double _weight;
        /// <summary>
        /// Property Weight (double)
        /// </summary>
        public double Weight
        {
            get {  return this._weight; }
            set {  this._weight = value; }
        }

    }


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -