- Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathEditDistanceCostsMap.cs
29 lines (26 loc) · 953 Bytes
/
EditDistanceCostsMap.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
usingSystem;
usingAlgorithms.Common;
namespaceAlgorithms.Strings
{
/// <summary>
/// Edit Distance Costs Map.
/// Helper class used with the EditDistance class.
/// </summary>
publicclassEditDistanceCostsMap<TCost>whereTCost:IComparable<TCost>,IEquatable<TCost>
{
publicTCostDeletionCost{get;set;}
publicTCostInsertionCost{get;set;}
publicTCostSubstitutionCost{get;set;}
/// <summary>
/// CONSTRUCTOR
/// </summary>
publicEditDistanceCostsMap(TCostinsertionCost,TCostdeletionCost,TCostsubstitutionCost)
{
if(false==default(TCost).IsNumber())
thrownewInvalidOperationException("Invalid cost type TCost. Please choose TCost to be a number.");
DeletionCost=deletionCost;
InsertionCost=insertionCost;
SubstitutionCost=substitutionCost;
}
}
}