private List <Term> getTerm(int feature) { try { List <Term> sourceTerms = null; switch (TSystem) { case FuzzySystemRelisedList.TypeSystem.PittsburghClassifier: { sourceTerms = PCFS.RulesDatabaseSet[0].TermsSet.Where(x => x.NumVar == feature).ToList(); break; } case FuzzySystemRelisedList.TypeSystem.Singletone: { sourceTerms = SAFS.RulesDatabaseSet[0].TermsSet.Where(x => x.NumVar == feature).ToList(); break; } case FuzzySystemRelisedList.TypeSystem.TakagiSugenoApproximate: { sourceTerms = TSAFS.RulesDatabaseSet[0].TermsSet.Where(x => x.NumVar == feature).ToList(); break; } } IComparer <Term> toSort = new TermComp(); sourceTerms.Sort(toSort); return(sourceTerms); } catch (Exception) { return(null); } }
public int CompareTo(ScoreTerm other) { if (this.Boost == other.Boost) { return(TermComp.Compare(other.Bytes, this.Bytes)); } else { return(this.Boost.CompareTo(other.Boost)); } }
public int CompareTo(ScoreTerm other) { // LUCENENET specific - compare bits rather than using equality operators to prevent these comparisons from failing in x86 in .NET Framework with optimizations enabled if (NumericUtils.SingleToSortableInt32(this.Boost) == NumericUtils.SingleToSortableInt32(other.Boost)) { return(TermComp.Compare(other.Bytes, this.Bytes)); } else { return(this.Boost.CompareTo(other.Boost)); } }