-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathStringComparisonElement.cs
44 lines (39 loc) · 1.14 KB
/
StringComparisonElement.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// StringComparisonElement.cs
//
// Author:
// Mārcis Pinnis <marcis.pinnis@gmail.com>
//
// Copyright (c) 2013 Mārcis Pinnis
//
// This program can be freely used only for scientific and educational purposes.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
using System;
namespace MPAligner
{
public class StringComparisonElement :IComparable<StringComparisonElement>
{
public StringComparisonElement ()
{
src=null;
trg=null;
similarity = 0;
}
public string src;
public string trg;
public double similarity;
#region IComparable implementation
int IComparable<StringComparisonElement>.CompareTo (StringComparisonElement other)
{
if (src==other.src)
{
return other.similarity.CompareTo(this.similarity); // From large to small.
}
return src.CompareTo(other.src); // From A to Z
}
#endregion
}
}