本文整理汇总了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类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
* */
}
示例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
}
示例3: LuceneTesterBase
public LuceneTesterBase(LuceneDirectory directory, LuceneAnalyzer analyzer, LuceneVersion version)
{
Analyzer = analyzer;
CurrentLuceneVersion = version;
IndexDirectory = directory;
Debug = false;
}
示例4: TheIndexService
public TheIndexService()
{
_version = Version.LUCENE_30;
_analyzer = new StandardAnalyzer(_version);
_path =
new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + ConfigurationManager.AppSettings["pathIndex"]);
}
示例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;
}
示例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>();
}
示例7: SearchService
public SearchService()
{
_lock = new object();
_version = Version.LUCENE_29;
_directory = new RAMDirectory();
_writer = new IndexWriter(_directory, new StandardAnalyzer(_version), IndexWriter.MaxFieldLength.UNLIMITED);
}
示例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;
}
示例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);
}
}
}
示例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));
}
示例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);
}
}
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例15: RangeQueryParser
public RangeQueryParser(Version matchVersion, string f, Analyzer a)
: base(matchVersion, f, a)
{
}