📄 word.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 + -