本文整理汇总了C#中Set.SymmetricDifference方法的典型用法代码示例。如果您正苦于以下问题:C# Set.SymmetricDifference方法的具体用法?C# Set.SymmetricDifference怎么用?C# Set.SymmetricDifference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Set
的用法示例。
在下文中一共展示了Set.SymmetricDifference方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadTextTagsForXfics
/// <summary>
///
/// </summary>
/// <param name="xfics"></param>
internal void LoadTextTagsForXfics(List<int> xfics)
{
List<int> textTagList = InterlinTaggingChild.GetTaggingReferencingTheseAnnotations(Cache, xfics, m_textTagAnnDefn);
Set<int> xficsTagged = new Set<int>();
foreach (int hvoTag in textTagList)
xficsTagged.AddRange(CacheTagString(hvoTag)); // Preload doesn't need PropChanged() to fire. This version doesn't.
// now go through the list of xfics that didn't have tags cached, and make sure they have empty strings cached
Set<int> xficsWithoutTags = xficsTagged.SymmetricDifference(xfics);
CacheNullTagString(xficsWithoutTags.ToArray(), false);
}
示例2: LoadDataForTextTags
/// <summary>
/// Given a segment (for which we should have just loaded the wordforms), load any associated text tagging data
/// </summary>
/// <param name="hvoSeg"></param>
private void LoadDataForTextTags(int hvoSeg)
{
// Get a 'real' Segment
ISegment curSeg;
try
{
curSeg = m_segRepository.GetObject(hvoSeg);
if (curSeg.AnalysesRS == null || curSeg.AnalysesRS.Count == 0)
return; // small sanity check
}
catch (KeyNotFoundException)
{
return; // Hmm... this could be a problem, but we'll just skip it for now.
}
// Get all AnalysisOccurrences in this Segment
// Resharper says the following LINQ is equivalent. OK, I guess!
//var segWords = new List<AnalysisOccurrence>();
//for (int i = 0; i < curSeg.AnalysesRS.Count; i++)
// segWords.Add(new AnalysisOccurrence(curSeg, i));
var segWords = curSeg.AnalysesRS.Select((t, i) => new AnalysisOccurrence(curSeg, i)).ToList();
// Find all the tags for this Segment's AnalysisOccurrences and cache them
var textTagList = InterlinTaggingChild.GetTaggingReferencingTheseWords(segWords);
var occurrencesTagged = new Set<AnalysisOccurrence>();
foreach (var tag in textTagList)
{
occurrencesTagged.AddRange(tag.GetOccurrences());
CacheTagString(tag);
}
// now go through the list of occurrences that didn't have tags cached, and make sure they have empty strings cached
var occurrencesWithoutTags = occurrencesTagged.SymmetricDifference(segWords);
if (occurrencesWithoutTags != null) CacheNullTagString(occurrencesWithoutTags);
}