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

C# Util.Version类代码示例

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

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



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

示例1: InitLanguages

        private void InitLanguages(Version version)
        {
            langs = new HashSet<int>(new int[] { 1, 2 });
            langSuffix = new Dictionary<int, string>();
            langAnalyzer = new Dictionary<int, Analyzer>();

            // Croatian
            langSuffix[1] = @"hr";
            langAnalyzer[1] = new CroAnalyzer(version);

            // English
            langSuffix[2] = @"en";
            langAnalyzer[2] = new StandardAnalyzer(version);
            /*
            // German
            langSuffix[3] = @"de";
            langAnalyzer[3] = new GermanAnalyzer(version);

            // Italian
            //langSuffix[4] = @"it";
            //langAnalyzer[4] = ???;

            // Czech
            langSuffix[5] = @"cz";
            langAnalyzer[5] = new CzechAnalyzer(version);
             * */
        }
开发者ID:bneuhold,项目名称:pb-dev,代码行数:27,代码来源:AnalyzerFactory.cs


示例2: AbstractAnalysisFactory

	  /// <summary>
	  /// Initialize this factory via a set of key-value pairs.
	  /// </summary>
	  protected internal AbstractAnalysisFactory(IDictionary<string, string> args)
	  {
		originalArgs = Collections.UnmodifiableMap(new Dictionary<>(args));
		string version = get(args, LUCENE_MATCH_VERSION_PARAM);
		luceneMatchVersion = version == null ? null : Version.ParseLeniently(version);
		args.Remove(CLASS_NAME); // consume the class arg
	  }
开发者ID:paulirwin,项目名称:lucene.net,代码行数:10,代码来源:AbstractAnalysisFactory.cs


示例3: LuceneTesterBase

 public LuceneTesterBase(LuceneDirectory directory, LuceneAnalyzer analyzer, LuceneVersion version)
 {
     Analyzer = analyzer;
     CurrentLuceneVersion = version;
     IndexDirectory = directory;
     Debug = false;
 }
开发者ID:joshball,项目名称:Lucene.In.Action.NET,代码行数:7,代码来源:LuceneTesterBase.cs


示例4: TheIndexService

 public TheIndexService()
 {
     _version = Version.LUCENE_30;
     _analyzer = new StandardAnalyzer(_version);
     _path =
         new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + ConfigurationManager.AppSettings["pathIndex"]);
 }
开发者ID:peisheng,项目名称:EASYFRAMEWORK,代码行数:7,代码来源:TheIndexService.cs


示例5: Context

 public Context(Directory directory, Analyzer analyzer, Version version, IIndexWriter indexWriter, object transactionLock)
 {
     this.directory = directory;
     this.analyzer = analyzer;
     this.version = version;
     this.indexWriter = indexWriter;
     this.transactionLock = transactionLock;
 }
开发者ID:benjaminramey,项目名称:Lucene.Net.Linq,代码行数:8,代码来源:Context.cs


示例6: LuceneIndex

 public LuceneIndex(string typeName, string indexDir, IDocumentBuilder docBuilder, IIndexPathBuilder pathBuilder, LN.Util.Version version)
 {
     this.TypeName = typeName;
     this.Directory = indexDir;
     this.version = version;
     this.DocumentBuilder = docBuilder;
     this.IndexPathBuilder = pathBuilder;
     indexPaths = new Dictionary<string, LuceneIndexPath>();
 }
开发者ID:cairabbit,项目名称:daf,代码行数:9,代码来源:LuceneIndex.cs


示例7: SearchService

        public SearchService()
        {
            _lock = new object();

            _version = Version.LUCENE_29;
            _directory = new RAMDirectory();

            _writer = new IndexWriter(_directory, new StandardAnalyzer(_version), IndexWriter.MaxFieldLength.UNLIMITED);
        }
开发者ID:iahdevelop,项目名称:moriyama-umbraco-runtime,代码行数:9,代码来源:SearchService.cs


示例8: ToQuery

        public Query ToQuery(Analyzer analyzer, Version version)
        {
            if (Empty)
            {
                throw new InvalidOperationException("No key fields defined.");
            }

            var query = new BooleanQuery();
            values.Apply(kvp => query.Add(Parse(new QueryParser(version, kvp.Key, analyzer), ConvertToQueryExpression(kvp)), Occur.MUST));
            return query;
        }
开发者ID:benjaminramey,项目名称:Lucene.Net.Linq,代码行数:11,代码来源:DocumentKey.cs


示例9: PersianAnalyzer

 public PersianAnalyzer(Version version)
 {
     _version = version;
     var fileStream =
         System.Reflection.Assembly.GetAssembly(GetType()).GetManifestResourceStream("Lucene.Net.Analysis.Fa." +
                                                                                          DefaultStopwordFile);
     if (fileStream != null)
         using (var reader = new StreamReader(fileStream))
         {
             while (!reader.EndOfStream)
             {
                 var word = reader.ReadLine();
                 if (word != null) _stoptable.Add(word, word);
             }
         }
 }
开发者ID:shahr00z,项目名称:Lucene.Net.Analysis.Fa,代码行数:16,代码来源:PersianAnalyzer.cs


示例10: SearchManager

        public SearchManager(string indexLocation)
        {
            if (string.IsNullOrEmpty(indexLocation))
                throw new FileNotFoundException("The lucene index could not be found.");

            _luceneVersion = Version.LUCENE_30;

            var resolvedServerLocation = HttpContext.Current.Server.MapPath(string.Format("~{0}", indexLocation));
            _directory = FSDirectory.Open(new DirectoryInfo(resolvedServerLocation));

            var createIndex = !IndexReader.IndexExists(_directory);

            _writer = new IndexWriter(_directory, new StandardAnalyzer(_luceneVersion), createIndex, IndexWriter.MaxFieldLength.UNLIMITED);

            _analyzer = new PerFieldAnalyzerWrapper(new StandardAnalyzer(_luceneVersion));
        }
开发者ID:parrymike,项目名称:myMDS_Dev,代码行数:16,代码来源:SearchManager.cs


示例11: MyAnalyzer

 public MyAnalyzer(Version version)
 {
     _version = version;
     var fileStream = new FileStream(@"..\..\..\data\" + DefaultStopwordFile,FileMode.Open);
     if (fileStream != null)
         using (var reader = new StreamReader(fileStream))
         {
             while (!reader.EndOfStream)
             {
                 var word = reader.ReadLine();
                 if (word != null)
                 {
                     word = SCICT.NLP.Utility.StringUtil.RefineAndFilterPersianWord(word); // Normalize characters of stop words
                     _stoptable.Add(word);
                 }
             }
         }
 }
开发者ID:imani,项目名称:Estefta,代码行数:18,代码来源:myAnalyzer.cs


示例12: QueryParser

		/// <summary> Constructs a query parser.
		/// 
		/// </summary>
		/// <param name="matchVersion">Lucene version to match. See <a href="#version">above</a>)
		/// </param>
		/// <param name="f">the default field for query terms.
		/// </param>
		/// <param name="a">used to find terms in the query text.
		/// </param>
		public QueryParser(Version matchVersion, System.String f, Analyzer a):this(new FastCharStream(new System.IO.StringReader("")))
		{
			analyzer = a;
			field = f;
			if (matchVersion.OnOrAfter(Version.LUCENE_29))
			{
				enablePositionIncrements = true;
			}
			else
			{
				enablePositionIncrements = false;
			}
		}
开发者ID:VirtueMe,项目名称:ravendb,代码行数:22,代码来源:QueryParser.cs


示例13: PatternAnalyzer

        /**
         * Constructs a new instance with the given parameters.
         * 
         * @param matchVersion If >= {@link Version#LUCENE_29}, StopFilter.enablePositionIncrement is set to true
         * @param Regex
         *            a regular expression delimiting tokens
         * @param toLowerCase
         *            if <code>true</code> returns tokens after applying
         *            String.toLowerCase()
         * @param stopWords
         *            if non-null, ignores all tokens that are contained in the
         *            given stop set (after previously having applied toLowerCase()
         *            if applicable). For example, created via
         *            {@link StopFilter#makeStopSet(String[])}and/or
         *            {@link org.apache.lucene.analysis.WordlistLoader}as in
         *            <code>WordlistLoader.getWordSet(new File("samples/fulltext/stopwords.txt")</code>
         *            or <a href="http://www.unine.ch/info/clef/">other stop words
         *            lists </a>.
         */
        public PatternAnalyzer(Version matchVersion, Regex Regex, bool toLowerCase, ISet<string> stopWords)
        {
            if (Regex == null)
                throw new ArgumentException("Regex must not be null");

            if (EqRegex(NON_WORD_PATTERN, Regex)) Regex = NON_WORD_PATTERN;
            else if (EqRegex(WHITESPACE_PATTERN, Regex)) Regex = WHITESPACE_PATTERN;

            if (stopWords != null && stopWords.Count == 0) stopWords = null;

            this.Regex = Regex;
            this.toLowerCase = toLowerCase;
            this.stopWords = stopWords;
            this.matchVersion = matchVersion;
        }
开发者ID:synhershko,项目名称:lucene.net,代码行数:34,代码来源:PatternAnalyzer.cs


示例14: CJKAnalyzer

 /// <summary>
 /// Builds an analyzer which removes words in the provided array.
 /// </summary>
 /// <param name="stopWords">stop word array</param>
 public CJKAnalyzer(Version matchVersion, params string[] stopWords)
 {
     stopTable = StopFilter.MakeStopSet(stopWords);
     this.matchVersion = matchVersion;
 }
开发者ID:synhershko,项目名称:lucene.net,代码行数:9,代码来源:CJKAnalyzer.cs


示例15: RangeQueryParser

		public RangeQueryParser(Version matchVersion, string f, Analyzer a)
			: base(matchVersion, f, a)
		{
		}
开发者ID:KyleGobel,项目名称:ravendb,代码行数:4,代码来源:RangeQueryParser.cs


示例16: RussianAnalyzer

        /*
         * Builds an analyzer with the given stop words.
         * @deprecated use {@link #RussianAnalyzer(Version, Set)} instead
         */
        public RussianAnalyzer(Version matchVersion, params string[] stopwords)
            : this(matchVersion, StopFilter.MakeStopSet(stopwords))
        {

        }
开发者ID:raol,项目名称:lucene.net,代码行数:9,代码来源:RussianAnalyzer.cs


示例17: StopAnalyzer

 /// <summary> Builds an analyzer with the stop words from the given file.
 /// 
 /// </summary>
 /// <seealso cref="WordlistLoader.GetWordSet(System.IO.FileInfo)">
 /// </seealso>
 /// <param name="matchVersion">See <a href="#version">above</a>
 /// </param>
 /// <param name="stopwordsFile">File to load stop words from
 /// </param>
 public StopAnalyzer(Version matchVersion, System.IO.FileInfo stopwordsFile)
 {
     stopWords = WordlistLoader.GetWordSet(stopwordsFile);
     enablePositionIncrements = StopFilter.GetEnablePositionIncrementsVersionDefault(matchVersion);
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:14,代码来源:StopAnalyzer.cs


示例18: CzechAnalyzer

  /*
   * Builds an analyzer with the given stop words.
   * 
   * @deprecated use {@link #CzechAnalyzer(Version, Set)} instead
   */
  public CzechAnalyzer(Version matchVersion, HashSet<string> stopwords) 
  : this(matchVersion, (ISet<string>)stopwords)
  {
    
	}
开发者ID:raol,项目名称:lucene.net,代码行数:10,代码来源:CzechAnalyzer.cs


示例19: DutchSubclassAnalyzer

            public DutchSubclassAnalyzer(Version matchVersion)
                : base(matchVersion)
            {

            }
开发者ID:synhershko,项目名称:lucene.net,代码行数:5,代码来源:TestDutchStemmer.cs


示例20: AnalyzerFactory

 public AnalyzerFactory(Version version = Version.LUCENE_30)
 {
     this.version = version;
     InitLanguages(version);
 }
开发者ID:bneuhold,项目名称:pb-dev,代码行数:5,代码来源:AnalyzerFactory.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# LuceneVersion类代码示例发布时间:2022-05-24
下一篇:
C# Util.BytesRef类代码示例发布时间: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