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


C# Token.GetPayload方法代码示例

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


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

示例1: GetWeight

        /// <summary>
        /// Returns a 32 bit float from the payload, or 1f it null.
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        public override float GetWeight(Token token)
        {
            if (token.GetPayload() == null || token.GetPayload().GetData() == null)
                return 1f;

            return PayloadHelper.DecodeFloat(token.GetPayload().GetData());
        }
开发者ID:kstenson,项目名称:NHibernate.Search,代码行数:12,代码来源:SimpleThreeDimensionalTokenSettingsCodec.cs

示例2: ConsumeStreamOldAPI

		private static void  ConsumeStreamOldAPI(TokenStream stream)
		{
			stream.Reset();
			Token reusableToken = new Token();
			
			int i = 0;
			while ((reusableToken = stream.Next(reusableToken)) != null)
			{
				System.String term = reusableToken.Term();
				Payload p = reusableToken.GetPayload();
				if (p != null && p.GetData().Length == 1 && p.GetData()[0] == PartOfSpeechAnnotatingFilter.PROPER_NOUN_ANNOTATION)
				{
					Assert.IsTrue("tokenstream".Equals(term), "only TokenStream is a proper noun");
				}
				else
				{
					Assert.IsFalse("tokenstream".Equals(term), "all other tokens (if this test fails, the special POSToken subclass is not correctly passed through the chain)");
				}
				Assert.AreEqual(results[i], term);
				i++;
			}
		}
开发者ID:Rationalle,项目名称:ravendb,代码行数:22,代码来源:TestTokenStreamBWComp.cs

示例3: SetCurrentToken

 private void SetCurrentToken(Token token)
 {
     if (token == null) return;
     ClearAttributes();
     _termAtt.SetTermBuffer(token.TermBuffer(), 0, token.TermLength());
     _posIncrAtt.SetPositionIncrement(token.GetPositionIncrement());
     _flagsAtt.SetFlags(token.GetFlags());
     _offsetAtt.SetOffset(token.StartOffset(), token.EndOffset());
     _typeAtt.SetType(token.Type());
     _payloadAtt.SetPayload(token.GetPayload());
 }
开发者ID:kstenson,项目名称:NHibernate.Search,代码行数:11,代码来源:PrefixAwareTokenStream.cs

示例4: VerifyPayload

		internal virtual void  VerifyPayload(TokenStream ts)
		{
			Token t = new Token();
			for (byte b = 1; ; b++)
			{
				t.Clear();
				t = ts.Next(t);
				if (t == null)
					break;
				// System.out.println("id="+System.identityHashCode(t) + " " + t);
				// System.out.println("payload=" + (int)t.getPayload().toByteArray()[0]);
				Assert.AreEqual(b, t.GetPayload().ToByteArray()[0]);
			}
		}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:14,代码来源:TestAnalyzers.cs


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