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


C# ITokenizer.Next方法代码示例

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


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

示例1: ParseListNoDelimiter

 private void ParseListNoDelimiter(ITokenizer tokenizer, Dictionary<string, string> result)
 {
     while ( !tokenizer.AtEnd && tokenizer.Token != ":" ) {
     String p1 = tokenizer.Token;
     tokenizer.Next();
     String p2 = tokenizer.Token;
     if ( p2 == "=" ) {
       tokenizer.Next();
       String p3 = tokenizer.Token;
       result[p1] = p3;
       tokenizer.Next();
     } else {
       result[p1] = "";
       // tokenizer.Token contains the next option we want to process
       // so don't consume it
     }
       }
 }
开发者ID:bayulabster,项目名称:viasfora,代码行数:18,代码来源:ModeLineParser.cs

示例2: ParseModeLine

        private void ParseModeLine(ITokenizer tokenizer, Dictionary<string, string> result)
        {
            // we expect it to look something like this:
              // vim: noai:ts=4:sw=4
              // vim: set noai ts=4 sw=4:
              if ( !tokenizer.Next() ) return;
              String tool = tokenizer.Token;
              if ( !tokenizer.Next() ) return;

              if ( tokenizer.Token != ":" ) return; // not what we expect
              if ( !tokenizer.Next() ) return;

              if ( tokenizer.Token == "set" ) {
            tokenizer.Next();
            ParseListNoDelimiter(tokenizer, result);
              } else {
            ParseList(tokenizer, result, ":");
              }
        }
开发者ID:bayulabster,项目名称:viasfora,代码行数:19,代码来源:ModeLineParser.cs

示例3: ParseList

 private void ParseList(ITokenizer tokenizer, Dictionary<string, string> result, string delimiter)
 {
     while ( !tokenizer.AtEnd ) {
     String p1 = tokenizer.Token;
     tokenizer.Next();
     String p2 = tokenizer.Token;
     if ( p2 == "=" ) {
       tokenizer.Next();
       String p3 = tokenizer.Token;
       result[p1] = p3;
       tokenizer.Next();
     } else {
       result[p1] = "";
     }
     if ( tokenizer.Token != delimiter ) break;
     // consume the delimiter
     tokenizer.Next();
       }
 }
开发者ID:bayulabster,项目名称:viasfora,代码行数:19,代码来源:ModeLineParser.cs

示例4: PennTreeReader

        /// <summary>
        /// Read parse trees from a Reader.
        /// </summary>
        /// <param name="input">The Reader</param>
        /// <param name="tf">TreeFactory -- factory to create some kind of Tree</param>
        /// <param name="tn">the method of normalizing trees</param>
        /// <param name="st">Tokenizer that divides up Reader</param>
        public PennTreeReader(TextReader input, ITreeFactory tf, TreeNormalizer tn, ITokenizer<string> st)
        {
            reader = input;
            treeFactory = tf;
            treeNormalizer = tn;
            tokenizer = st;

            // check for whacked out headers still present in Brown corpus in Treebank 3
            string first = (st.HasNext() ? st.Peek() : null);
            if (first != null && first.StartsWith("*x*x*x"))
            {
                int foundCount = 0;
                while (foundCount < 4 && st.HasNext())
                {
                    first = st.Next();
                    if (first != null && first.StartsWith("*x*x*x"))
                    {
                        foundCount++;
                    }
                }
            }
        }
开发者ID:gblosser,项目名称:OpenNlp,代码行数:29,代码来源:PennTreeReader.cs


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