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


C# ITokenizer.GetType方法代码示例

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


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

示例1: MetricRun

        public static void MetricRun(IReworder reworder, IReader reader, ITokenizer tok, ISparseDistance dist, int nbNeighbours, bool train, bool proba, string questionFilePath, string encyclopediaFilePath, string outFolder)
        {
            string encyclopediaName = Path.GetFileNameWithoutExtension(encyclopediaFilePath);

            string summary = "Metric_" + reworder.GetType().Name + "_" +
                reader.GetType().Name + "_" + tok.GetType().Name + "_" + dist.GetType().Name + "_" + nbNeighbours.ToString() + "_" + encyclopediaName;
            Console.Write("\n" + summary);

            SparseMatcher robot = new SparseMatcher(dist, reworder, reader, tok, encyclopediaFilePath);
            string[] answers = robot.Answer(nbNeighbours, questionFilePath, train, proba);

            if (train)
            {
                EvaluateAndPrintScores(questionFilePath, answers);
            }
            else
            {
                string[] ids = TextToData.ImportColumn(questionFilePath, 0);
                Submissions.Write(answers, ids, outFolder + summary + ".csv");
            }

            Console.WriteLine();
        }
开发者ID:turboNinja2,项目名称:Rob-The-Robot,代码行数:23,代码来源:Pipeline.cs

示例2: DocumentCategorizerFactory

        /// <summary>
        /// Initializes a new instance of the <see cref="DocumentCategorizerFactory"/> with the specified tokenizer and the feature generatos.
        /// </summary>
        /// <param name="tokenizer">The tokenizer.</param>
        /// <param name="featureGenerators">The feature generators.</param>
        /// <exception cref="System.ArgumentNullException">
        /// <paramref name="tokenizer"/>
        /// or
        /// <paramref name="featureGenerators"/>
        /// </exception>
        /// <exception cref="System.ArgumentException">The specified tokenizer is not registered in the type resolver.</exception>
        public DocumentCategorizerFactory(ITokenizer tokenizer, IFeatureGenerator[] featureGenerators) {
            if (tokenizer == null)
                throw new ArgumentNullException("tokenizer");

            if (featureGenerators == null)
                throw new ArgumentNullException("featureGenerators");

            if (!Library.TypeResolver.IsRegistered(tokenizer.GetType()))
                throw new ArgumentException("The specified tokenizer is not registered in the type resolver.");

            foreach (var featureGenerator in featureGenerators) {

                if (featureGenerator == null)
                    throw new ArgumentException("The feature generators must not have any null objects.");

                if (!Library.TypeResolver.IsRegistered(featureGenerator.GetType()))
                    throw new ArgumentException(string.Format("The feature generator type {0} is not registered in the type resolver.", featureGenerator.GetType().Name));                   
                
            }


            this.featureGenerators = featureGenerators;
            this.tokenizer = tokenizer;
        }
开发者ID:knuppe,项目名称:SharpNL,代码行数:35,代码来源:DocumentCategorizerFactory.cs


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