本文整理汇总了C#中ISet.Overlaps方法的典型用法代码示例。如果您正苦于以下问题:C# ISet.Overlaps方法的具体用法?C# ISet.Overlaps怎么用?C# ISet.Overlaps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISet
的用法示例。
在下文中一共展示了ISet.Overlaps方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getRatedEntries
internal IEnumerable<RatedEntry> getRatedEntries(ISet<string> allowedPOS, bool isZeroSuffix)
{
bool isEmpty = allowedPOS == null || allowedPOS.Count == 0;
foreach (RatedEntry re in entries) {
if (isZeroSuffix && (re.entry.POS.Count == 0 || !Inflector.knownPOS.Overlaps(re.entry.POS)) || (!isEmpty && allowedPOS.Overlaps(re.entry.POS))) {
yield return re;
}
}
}
示例2: TraverseDependencyChain
/// <summary>
/// Determines the set of adapters in the dependency chain that produces the set of signals in the
/// <paramref name="inputMeasurementKeysRestriction"/> and returns the set of input signals required by the
/// adapters in the chain and the set of output signals produced by the adapters in the chain.
/// </summary>
/// <param name="inputMeasurementKeysRestriction">The set of signals that must be produced by the dependency chain.</param>
/// <param name="inputAdapterCollection">Collection of input adapters at start of routing table calculation.</param>
/// <param name="actionAdapterCollection">Collection of action adapters at start of routing table calculation.</param>
/// <param name="outputAdapterCollection">Collection of output adapters at start of routing table calculation.</param>
protected virtual ISet<IAdapter> TraverseDependencyChain(ISet<MeasurementKey> inputMeasurementKeysRestriction, IInputAdapter[] inputAdapterCollection, IActionAdapter[] actionAdapterCollection, IOutputAdapter[] outputAdapterCollection)
{
ISet<IAdapter> dependencyChain = new HashSet<IAdapter>();
if ((object)inputAdapterCollection != null)
{
foreach (IInputAdapter inputAdapter in inputAdapterCollection)
{
if (!dependencyChain.Contains(inputAdapter) && inputMeasurementKeysRestriction.Overlaps(inputAdapter.OutputMeasurementKeys()))
AddInputAdapter(inputAdapter, dependencyChain, inputAdapterCollection, actionAdapterCollection, outputAdapterCollection);
}
}
if ((object)actionAdapterCollection != null)
{
foreach (IActionAdapter actionAdapter in actionAdapterCollection)
{
if (!dependencyChain.Contains(actionAdapter) && inputMeasurementKeysRestriction.Overlaps(actionAdapter.OutputMeasurementKeys()))
AddActionAdapter(actionAdapter, dependencyChain, inputAdapterCollection, actionAdapterCollection, outputAdapterCollection);
}
}
return dependencyChain;
}
示例3: getRatedEntriesWithPageNumber
internal IEnumerable<Tuple<int, RatedEntry>> getRatedEntriesWithPageNumber(ISet<string> allowedPOS, bool isZeroSuffix, bool returnAll)
{
bool isEmpty = allowedPOS == null || allowedPOS.Count == 0;
int i = 0;
List<Tuple<int, RatedEntry>> firstMatches = new List<Tuple<int, RatedEntry>>();
//List<Tuple<int, RatedEntry>> otherMatches = new List<Tuple<int, RatedEntry>>();
foreach (RatedEntry re in entries) {
if (returnAll || (isZeroSuffix && (re.entry.POS.Count == 0 || !Inflector.knownPOS.Overlaps(re.entry.POS)) || (!isEmpty && allowedPOS.Overlaps(re.entry.POS)))) {
firstMatches.Add(Tuple.Create(i, re));
} else {
/*if (stem != "") { // buggy bugs :(
otherMatches.Add(Tuple.Create(i, re));
}*/
}
i += 1;
}
return firstMatches.OrderByDescending((t) => t.Item2); //.Concat(otherMatches.OrderByDescending((t) => t.Item2));
}