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