Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
RelevanceOrder.cs
1using System;
2using System.Collections.Generic;
3
5{
9 public class RelevanceOrder : IComparer<MatchInformation>
10 {
15 {
16 }
17
22 {
23 int i = (int)(y.NrDistinctTokens - x.NrDistinctTokens);
24 if (i != 0)
25 return i;
26
27 long l = (long)(y.NrTokens - x.NrTokens);
28
29 if (l < 0)
30 return -1;
31 else if (l > 0)
32 return 1;
33
34 return y.Timestamp.CompareTo(x.Timestamp);
35 }
36 }
37}
Contains matching information about a document in a search.
uint NrDistinctTokens
Number of distinct tokens found.
RelevanceOrder()
Orders entries based on relevance.
int Compare(MatchInformation x, MatchInformation y)
IComparer<MatchInformation>.Compare