• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Term类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Term的典型用法代码示例。如果您正苦于以下问题:C# Term类的具体用法?C# Term怎么用?C# Term使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Term类属于命名空间,在下文中一共展示了Term类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SortChildTerms

        private static IEnumerable<Term> SortChildTerms(Term parentTerm)
        {
            var sortedChildren = new List<Term>();

            // If custom sort order is set, build term list in sorted order
            if (!string.IsNullOrEmpty(parentTerm.CustomSortOrder))
            {
                var children = parentTerm.Terms.ToList();
                var sortedIds = parentTerm.CustomSortOrder.Split(':').Select(id => new Guid(id)).ToList();
                foreach (var sortedId in sortedIds)
                {
                    var sortedTerm = children.SingleOrDefault(term => term.Id.Equals(sortedId));
                    if (sortedTerm != null)
                    {
                        sortedChildren.Add(sortedTerm);
                    }
                }

                // Add unsorted terms at the end of the collection
                var unsortedTerms = children.Where(term => !sortedIds.Contains(term.Id));
                sortedChildren.AddRange(unsortedTerms);
            }
            else
            {
                sortedChildren = parentTerm.Terms.ToList();
            }

            return sortedChildren;
        }
开发者ID:GSoft-SharePoint,项目名称:Dynamite-2010-Components,代码行数:29,代码来源:NavigationNodeRepository.cs


示例2: TermSpans

		public TermSpans(TermPositions positions, Term term)
		{
			
			this.internalPositions = positions;
			this.term = term;
			internalDoc = - 1;
		}
开发者ID:mindis,项目名称:Transformalize,代码行数:7,代码来源:TermSpans.cs


示例3: TermEquality

 public TermEquality(Term term1, Term term2)
 {
     this.term1 = term1;
     this.term2 = term2;
     terms.Add(term1);
     terms.Add(term2);
 }
开发者ID:PaulMineau,项目名称:AIMA.Net,代码行数:7,代码来源:TermEquality.cs


示例4: GetStringParam

 public static string GetStringParam(Term[] arg, ref SMath.Math.Store context)
 {
   var dbl = GetNumberParam(arg, ref context).obj as SMath.Math.Numeric.TDouble;
   if (!dbl.isText)
     throw new SMath.Manager.EvaluationException(Errors.ArgumentMustBeString);
   return dbl.ToString().Trim('"');
 }
开发者ID:saha84,项目名称:CoolProp,代码行数:7,代码来源:coolpropPlugin.cs


示例5: ImportTerm

        public void ImportTerm(Term parentTerm, XElement termElement, bool recurse = true)
        {
            try
            {

                //Get the LCID.
                //TODO: Support importing LCIDs
                int lcid = CultureInfo.CurrentCulture.LCID;

                //Get the term name
                string termName = (string)termElement.Attribute("Name");

                //Check if the term exist
                Term term = parentTerm.GetTerms(termName, lcid, true, StringMatchOption.ExactMatch, 1, false).FirstOrDefault();

                //If the term does not exist, create it
                if (term == null)
                {
                    term = parentTerm.CreateTerm(termName, lcid);
                }

                //Create the child terms
                if (recurse)
                {
                    foreach (XElement childElement in termElement.Elements())
                    {
                        ImportTerm(term, childElement, recurse);
                    }
                }
            }
            catch (Exception e)
            {
            }
        }
开发者ID:ashwnacharya,项目名称:SPMetadataManager,代码行数:34,代码来源:Importer.cs


示例6: SegmentMergeInfo

		internal SegmentMergeInfo(int b, TermEnum te, IndexReader r)
		{
			base_Renamed = b;
			reader = r;
			termEnum = te;
			term = te.Term;
		}
开发者ID:mindis,项目名称:Transformalize,代码行数:7,代码来源:SegmentMergeInfo.cs


示例7: BinaryTerm

 private BinaryTerm(RiakFluentSearch search, string field, Op op, Term left)
     : base(search, field)
 {
     _op = op;
     _left = left;
     left.Owner = this;
 }
开发者ID:taliesins,项目名称:CorrugatedIron,代码行数:7,代码来源:BinaryTerm.cs


示例8: TVec

 private TVec(Term[] left, Term[] right, Func<Term, Term, Term> elemOp)
 {
     Contract.Assume(left.Length == right.Length);
     terms = new Term[left.Length];
     for (int i = 0; i < terms.Length; ++i)
         terms[i] = elemOp(left[i], right[i]);
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:7,代码来源:TVec.cs


示例9: AbstractBaseMutexEvaluator

 /// <summary>
 /// Initializes a new instance of the <see cref="AbstractBaseMutexEvaluator"/> class.
 /// </summary>
 /// <param name="conditional">The conditional.</param>
 /// <param name="predicate">The predicate.</param>
 /// <param name="subject">The subject.</param>
 public AbstractBaseMutexEvaluator(Term conditional, Term predicate, Term subject)
 {
     _conditionalTerm = conditional;
     _predicate = predicate;
     _subjectTerm = subject;
     _sorter = new Dictionary<object, List<WME>>();
 }
开发者ID:KristenWegner,项目名称:expergent,代码行数:13,代码来源:AbstractBaseMutexEvaluator.cs


示例10: Find

 private static Optimizer Find(Term term, int dist)
 {
     if(term==null) return null;
     Term next=term.next;
     Term.TermType type=term.type;
     switch(type){
     case Term.TermType.CHAR:
     case Term.TermType.REG:
     case Term.TermType.REG_I:
         return new Optimizer(term,dist);
     case Term.TermType.BITSET:
     case Term.TermType.BITSET2:
         if(term.weight<=THRESHOLD) return new Optimizer(term,dist);
         else return Find(term.next,dist+1);
     case Term.TermType.ANY_CHAR:
     case Term.TermType.ANY_CHAR_NE:
         return Find(next,dist+1);
     case Term.TermType.REPEAT_MIN_INF:
     case Term.TermType.REPEAT_MIN_MAX:
         if(term.minCount>0){
             return Find(term.target,dist);
         }
         else return null;
     case Term.TermType.BOUNDARY: case Term.TermType.DIRECTION: case Term.TermType.UBOUNDARY: case Term.TermType.UDIRECTION:
     case Term.TermType.GROUP_IN: case Term.TermType.GROUP_OUT: case Term.TermType.VOID: case Term.TermType.START: case Term.TermType.END:
     case Term.TermType.END_EOL: case Term.TermType.LINE_START: case Term.TermType.LINE_END: case Term.TermType.LAST_MATCH_END:
     case Term.TermType.CNT_SET_0: case Term.TermType.CNT_INC: case Term.TermType.CNT_GT_EQ: case Term.TermType.READ_CNT_LT:
     case Term.TermType.CRSTORE_CRINC: case Term.TermType.CR_SET_0: case Term.TermType.CR_LT: case Term.TermType.CR_GT_EQ:
         return Find(next,dist);
     }
     return null;
 }
开发者ID:olabini,项目名称:nregex,代码行数:32,代码来源:Optimizer.cs


示例11: Identity

 /// <summary>
 /// Define a function.
 /// </summary>
 /// <param name="body">The function body.</param>
 /// <returns>A function.</returns>
 public static Identity Identity(Func<Term, Term, Identity> body)
 {
     var p = body.Method.GetParameters();
     var x0 = new Term(0);
     var x1 = new Term(1);
     return body(x0, x1);
 }
开发者ID:naasking,项目名称:Algebra.NET,代码行数:12,代码来源:AlgebraGenerated.cs


示例12: Rule

 public Rule(Term.Term antecent, Term.Term consequence)
 {
     if (antecent == null) throw new ArgumentNullException("antecent");
     if (consequence == null) throw new ArgumentNullException("consequence");
     _antecent = antecent;
     _consequence = consequence;
 }
开发者ID:luukholleman,项目名称:Imperator-Fundum,代码行数:7,代码来源:Rule.cs


示例13: stringValueFromTerm

        public static String stringValueFromTerm(Term t)
        {
            var result = string.Empty;

              Term tt = t.getTerm();
              if (tt is Struct)
              {
            result = ((Struct)tt).getName();
            if (result.Equals("."))
            {
              result = tt.ToString();
            }
              }
              else if (tt is Number)
              {
            Number n = (Number)tt;
            if (n is Int)
            {
              result = n.intValue().ToString();
            }
            else
            {
              result = n.ToString();
            }
              }

              return result;
        }
开发者ID:rrutt,项目名称:NewsGogglesDotNet,代码行数:28,代码来源:PrologLibrary.cs


示例14: SeatArrangement

 public SeatArrangement(Term source,ISimpleEmployee agent, DateTime start, DateTime end)
 {
     Agent = agent;
     Start = start;
     End = end;
     Source = source;
 }
开发者ID:Mrding,项目名称:Ribbon,代码行数:7,代码来源:SeatArrangement.cs


示例15: EqualsTestEquality

        public void EqualsTestEquality()
        {
            Term o1 = new Term("foo");
            Term o2 = new Term("foo");

            Assert.IsTrue(o1.Equals(o2));
        }
开发者ID:feupeu,项目名称:NyhedsfilterP2,代码行数:7,代码来源:TermTest.cs


示例16: Check_Next_Free_3

 public Check_Next_Free_3(Term a1, Term a2, Term a3, Predicate cont)
 {
     arg1 = a1;
     arg2 = a2;
     arg3 = a3;
     this.cont = cont;
 }
开发者ID:prosardar,项目名称:BAD,代码行数:7,代码来源:Check_+Next_+Free_3.cs


示例17: setArgument

 public override void setArgument(Term[] args, Predicate cont)
 {
     arg1 = args[0];
     arg2 = args[1];
     arg3 = args[2];
     this.cont = cont;
 }
开发者ID:prosardar,项目名称:BAD,代码行数:7,代码来源:Check_+Next_+Free_3.cs


示例18: MakePlan

 public static PlanItem[] MakePlan(PlanItem[] plan, Term t)
 {
     if (t is Name) return plan.Concat(Term(t)).ToArray();
     var app = (App)t;
     if (plan.Length == 0)
     {
         if (app.left is App)
         {
             return MakePlan(MakePlan(plan, app.left), app.right);
         }
         else
         {
             var name = (Name)app.left;
             return MakePlan(plan, app.right).Concat(new[] { new PlanItem { Card = name.name, ToLeft = true } }).ToArray();
         }
     }
     return
         MakePlan(
             MakePlan(
                 plan.Concat(SK()).ToArray(),
                 app.left)
                 .Concat(SK())
                 .Concat(Term("I")).ToArray(),
                 app.right);
 }
开发者ID:xoposhiy,项目名称:loopbreakers,代码行数:25,代码来源:ThePlan.cs


示例19: AutomatonQuery

 /// <summary>
 /// Create a new AutomatonQuery from an <seealso cref="Automaton"/>.
 /// </summary>
 /// <param name="term"> Term containing field and possibly some pattern structure. The
 ///        term text is ignored. </param>
 /// <param name="automaton"> Automaton to run, terms that are accepted are considered a
 ///        match. </param>
 public AutomatonQuery(Term term, Automaton automaton)
     : base(term.Field)
 {
     this.Term = term;
     this.Automaton_Renamed = automaton;
     this.Compiled = new CompiledAutomaton(automaton);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:14,代码来源:AutomatonQuery.cs


示例20: Function

 /// <summary>
 /// Define a function.
 /// </summary>
 /// <param name="body">The function body.</param>
 /// <returns>A function.</returns>
 public static Function<Func<double, double, double>> Function(Func<Term, Term, Function<Func<double, double,  double>>> body)
 {
     var p = body.Method.GetParameters();
     var x0 = new Term(0);
     var x1 = new Term(1);
     return body(x0, x1).With(p);
 }
开发者ID:naasking,项目名称:Algebra.NET,代码行数:12,代码来源:AlgebraGenerated.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TermPart类代码示例发布时间:2022-05-24
下一篇:
C# Tenant类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap