public int[] FilterConsolidatedLanguageVersions(int[] docLangIds, FilterDocsStruct filterDocsStruct, int[] langPreferences) { if (langPreferences?.Any() != true || filterDocsStruct?.FilterDocInfos?.Any() != true) { return(docLangIds); } var nonConsolidatedDocLangIds = new List <int>(); var consolidatedInfo = new List <ConsolidatedFullActModel>(); foreach (var docLangId in docLangIds) { var langInfo = filterDocsStruct.FilterDocInfos[docLangId]; if (docLangId < ActsArray.Length && ActsArray[docLangId] != null) { var consolidated = ActsArray[docLangId]; consolidatedInfo.Add(new ConsolidatedFullActModel { DocLangId = docLangId, LangId = langInfo.LangId, LeadDocLangId = consolidated.LeadDocId, IsBase = consolidated.IsBase }); } else { nonConsolidatedDocLangIds.Add(docLangId); } } var preferedLang = langPreferences[0]; var consolidatedForLanguage = consolidatedInfo.Where(x => x.LangId == preferedLang).ToList(); return(nonConsolidatedDocLangIds.Concat(consolidatedForLanguage.Select(x => x.DocLangId)).ToArray()); }
public void Refresh() { if (this.searchWrapper != null) { this.searchWrapper.Dispose(); this.searchWrapper = null; } this.searchWrapper = new EUCasesSearchWrapper(this.ftiPath); this.filterDocsStruct = new FilterDocsStruct(); this.filterDocsStruct.LoadFromFile(this.docToClassifierPath); this.resultsGrouper = new ResultsGrouper(this.resultsGrouperPath); }