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


C# Set.AddAll方法代码示例

本文整理汇总了C#中Set.AddAll方法的典型用法代码示例。如果您正苦于以下问题:C# Set.AddAll方法的具体用法?C# Set.AddAll怎么用?C# Set.AddAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Set的用法示例。


在下文中一共展示了Set.AddAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SemanticHeadFinder

        /// <summary>
        /// Create a SemanticHeadFinder
        /// </summary>
        /// <param name="tlp">
        /// The TreebankLanguagePack, used by the superclass to get basic category of constituents
        /// </param>
        /// <param name="noCopulaHead">
        /// If true, a copular verb (be, seem, appear, stay, remain, resemble, become)
        /// is not treated as head when it has an AdjP or NP complement.  If false,
        /// a copula verb is still always treated as a head.  But it will still
        /// be treated as an auxiliary in periphrastic tenses with a VP complement.
        /// </param>
        public SemanticHeadFinder(AbstractTreebankLanguagePack tlp, bool noCopulaHead) : base(tlp)
        {
            RuleChanges();

            // make a distinction between auxiliaries and copula verbs to
            // get the NP has semantic head in sentences like "Bill is an honest man".  (Added "sha" for "shan't" May 2009
            verbalAuxiliaries = new Util.HashSet<string>(Auxiliaries);

            passiveAuxiliaries = new Util.HashSet<string>(BeGetVerbs);

            //copula verbs having an NP complement
            copulars = new Util.HashSet<string>();
            if (noCopulaHead)
            {
                copulars.AddAll(CopulaVerbs);
            }

            // TODO: reverse the polarity of noCopulaHead
            this.makeCopulaHead = !noCopulaHead;

            verbalTags = new Util.HashSet<string>(VerbTags);
            unambiguousAuxiliaryTags = new Util.HashSet<string>(UnambiguousAuxTags);
        }
开发者ID:gblosser,项目名称:OpenNlp,代码行数:35,代码来源:SemanticHeadFinder.cs

示例2: ChildrenDisj

 public TregexPattern ChildrenDisj()
 {
     var children = new List<TregexPattern>();
     // When we keep track of the known variables to assert that
     // variables are not redefined, or that links are only set to known
     // variables, we want to separate those done in different parts of the
     // disjunction.  Variables set in one part won't be set in the next
     // part if it gets there, since disjunctions exit once known.
     var originalKnownVariables = new Set<string>(knownVariables);
     // However, we want to keep track of all the known variables, so that after
     // the disjunction is over, we know them all.
     var allKnownVariables = new Set<string>(knownVariables);
     TregexPattern child = ChildrenConj();
     children.Add(child);
     allKnownVariables.AddAll(knownVariables);
     //label_3:
     while (true)
     {
         if (Jj_2_2(2))
         {
             ;
         }
         else
         {
             //break label_3;
             break;
         }
         knownVariables = new Set<string>(originalKnownVariables);
         Jj_consume_token(12);
         child = ChildrenConj();
         children.Add(child);
         allKnownVariables.AddAll(knownVariables);
     }
     knownVariables = allKnownVariables;
     if (children.Count == 1)
     {
         return child;
     }
     else
     {
         return new CoordinationPattern(children, false);
     }
 }
开发者ID:gblosser,项目名称:OpenNlp,代码行数:43,代码来源:TregexParser.cs


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