Ai
1 Star 1 Fork 0

AndyZhang/C-Sharp-Algorithms

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
EditDistanceCostsMap.cs 953 Bytes
一键复制 编辑 原始数据 按行查看 历史
using System;
using Algorithms.Common;
namespace Algorithms.Strings
{
/// <summary>
/// Edit Distance Costs Map.
/// Helper class used with the EditDistance class.
/// </summary>
public class EditDistanceCostsMap<TCost> where TCost : IComparable<TCost>, IEquatable<TCost>
{
public TCost DeletionCost { get; set; }
public TCost InsertionCost { get; set; }
public TCost SubstitutionCost { get; set; }
/// <summary>
/// CONSTRUCTOR
/// </summary>
public EditDistanceCostsMap(TCost insertionCost, TCost deletionCost, TCost substitutionCost)
{
if (false == default(TCost).IsNumber())
throw new InvalidOperationException("Invalid cost type TCost. Please choose TCost to be a number.");
DeletionCost = deletionCost;
InsertionCost = insertionCost;
SubstitutionCost = substitutionCost;
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/strongandyzhang/C-Sharp-Algorithms.git
git@gitee.com:strongandyzhang/C-Sharp-Algorithms.git
strongandyzhang
C-Sharp-Algorithms
C-Sharp-Algorithms
master

搜索帮助