本文整理汇总了C#中ICollection.GetUnionKeys方法的典型用法代码示例。如果您正苦于以下问题:C# ICollection.GetUnionKeys方法的具体用法?C# ICollection.GetUnionKeys怎么用?C# ICollection.GetUnionKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICollection
的用法示例。
在下文中一共展示了ICollection.GetUnionKeys方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAcceptingFeatures
private static IEnumerable<string> CreateAcceptingFeatures(
ICollection<CstNode> acceptedNodes, FeatureExtractor extractor, ICollection<SelectedFragment> fragments) {
var acceptingFeatures = acceptedNodes
.GetUnionKeys(fragments, extractor)
.Distinct()
.ToList();
acceptingFeatures.Sort((s1, s2) => s1.Length.CompareTo(s2.Length));
return acceptingFeatures;
}
示例2: CreateRejectingFeatures
private IEnumerable<string> CreateRejectingFeatures(
ICollection<CstNode> rejectedNodes, FeatureExtractor extractor, ICollection<SelectedFragment> fragments) {
var rejectingFeatureSet = rejectedNodes
.GetUnionKeys(fragments, extractor)
.ToHashSet();
rejectingFeatureSet.ExceptWith(AcceptingFeatures);
var rejectingFeatures = rejectingFeatureSet.ToList();
rejectingFeatures.Sort((s1, s2) => s1.Length.CompareTo(s2.Length));
return rejectingFeatures;
}