当前位置: 首页>>代码示例>>C#>>正文


C# ISet.Overlaps方法代码示例

本文整理汇总了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;
         }
     }
 }
开发者ID:wareya,项目名称:chiitrans,代码行数:9,代码来源:EdictMatch.cs

示例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;
        }
开发者ID:rmc00,项目名称:gsf,代码行数:33,代码来源:RoutingTables.cs

示例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));
 }
开发者ID:wareya,项目名称:chiitrans,代码行数:18,代码来源:EdictMatch.cs


注:本文中的ISet.Overlaps方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。