public override void onQueryAction(QueryAction queryAction) { for (int i = queryAction.nTerms - 1; i >= 0; i--) { currentList.Add(queryAction.terms[i]); } }
public static User GetCentroid(List <User> users) { var allTerms = new BinarySearchSet <int>(Comparer <int> .Default); foreach (var user in users) { foreach (var term in user.terms) { allTerms.Add(term); } } return(new User() { userId = -1, terms = allTerms }); }
public override void onQueryAction(QueryAction queryAction) { for (int i = queryAction.nUrls - 1; i >= 0; i--) { if (!currentDomains.Add(queryAction.domains[i])) { continue; } if (!domainsTerms.ContainsKey(queryAction.domains[i])) { domainsTerms.Add(queryAction.domains[i], new BinarySearchSet <int>(Comparer <int> .Default)); } BinarySearchSet <int> domainSet = domainsTerms[queryAction.domains[i]]; for (int term = queryAction.nTerms - 1; term >= 0; term--) { domainSet.Add(queryAction.terms[term]); } } currentDomains.Clear(); }