Class AbstractAnalysisFactory
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Inherited Members
Namespace: Lucene.Net.Analysis.Util
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public abstract class AbstractAnalysisFactory
Constructors
AbstractAnalysisFactory(IDictionary<string, string>)
Initialize this factory via a set of key-value pairs.
Declaration
protected AbstractAnalysisFactory(IDictionary<string, string> args)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args |
Fields
LUCENE_MATCH_VERSION_PARAM
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public const string LUCENE_MATCH_VERSION_PARAM = "luceneMatchVersion"
Field Value
| Type | Description |
|---|---|
| string |
m_luceneMatchVersion
the luceneVersion arg
Declaration
protected readonly LuceneVersion m_luceneMatchVersion
Field Value
| Type | Description |
|---|---|
| LuceneVersion |
Properties
IsExplicitLuceneMatchVersion
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public virtual bool IsExplicitLuceneMatchVersion { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
LuceneMatchVersion
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public LuceneVersion LuceneMatchVersion { get; }
Property Value
| Type | Description |
|---|---|
| LuceneVersion |
OriginalArgs
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public IDictionary<string, string> OriginalArgs { get; }
Property Value
| Type | Description |
|---|---|
| IDictionary<string, string> |
Methods
AssureMatchVersion()
this method can be called in the Create(TextReader) or Create(TokenStream) methods, to inform user, that for this factory a m_luceneMatchVersion is required
Declaration
protected void AssureMatchVersion()
Get(IDictionary<string, string>, string, ICollection<string>)
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public string Get(IDictionary<string, string> args, string name, ICollection<string> allowedValues)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name | |
| ICollection<string> | allowedValues |
Returns
| Type | Description |
|---|---|
| string |
Get(IDictionary<string, string>, string, ICollection<string>, string)
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public string Get(IDictionary<string, string> args, string name, ICollection<string> allowedValues, string defaultVal)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name | |
| ICollection<string> | allowedValues | |
| string | defaultVal |
Returns
| Type | Description |
|---|---|
| string |
Get(IDictionary<string, string>, string, ICollection<string>, string, bool)
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public string Get(IDictionary<string, string> args, string name, ICollection<string> allowedValues, string defaultVal, bool caseSensitive)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name | |
| ICollection<string> | allowedValues | |
| string | defaultVal | |
| bool | caseSensitive |
Returns
| Type | Description |
|---|---|
| string |
Get(IDictionary<string, string>, string, string)
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public string Get(IDictionary<string, string> args, string name, string defaultVal = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name | |
| string | defaultVal |
Returns
| Type | Description |
|---|---|
| string |
GetBoolean(IDictionary<string, string>, string, bool)
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
protected bool GetBoolean(IDictionary<string, string> args, string name, bool defaultVal)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name | |
| bool | defaultVal |
Returns
| Type | Description |
|---|---|
| bool |
GetChar(IDictionary<string, string>, string, char)
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public virtual char GetChar(IDictionary<string, string> args, string name, char defaultVal)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name | |
| char | defaultVal |
Returns
| Type | Description |
|---|---|
| char |
GetClassArg()
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public virtual string GetClassArg()
Returns
| Type | Description |
|---|---|
| string | the string used to specify the concrete class name in a serialized representation: the class arg.
If the concrete class name was not specified via a class arg, returns |
GetCulture(IDictionary<string, string>, string, CultureInfo)
Gets a CultureInfo value of the specified argument key name.
"invariant".
LUCENENET specific
Declaration
protected CultureInfo GetCulture(IDictionary<string, string> args, string name, CultureInfo defaultVal)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name | |
| CultureInfo | defaultVal |
Returns
| Type | Description |
|---|---|
| CultureInfo |
GetInt32(IDictionary<string, string>, string, int)
NOTE: This was getInt() in Lucene
Declaration
protected int GetInt32(IDictionary<string, string> args, string name, int defaultVal)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name | |
| int | defaultVal |
Returns
| Type | Description |
|---|---|
| int |
GetLines(IResourceLoader, string)
Returns the resource's lines (with content treated as UTF-8)
Declaration
protected IList<string> GetLines(IResourceLoader loader, string resource)
Parameters
| Type | Name | Description |
|---|---|---|
| IResourceLoader | loader | |
| string | resource |
Returns
| Type | Description |
|---|---|
| IList<string> |
GetPattern(IDictionary<string, string>, string)
Compiles a pattern for the value of the specified argument key name
Declaration
protected Regex GetPattern(IDictionary<string, string> args, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name |
Returns
| Type | Description |
|---|---|
| Regex |
GetSet(IDictionary<string, string>, string)
Returns whitespace- and/or comma-separated set of values, or null if none are found
Declaration
public virtual ISet<string> GetSet(IDictionary<string, string> args, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name |
Returns
| Type | Description |
|---|---|
| ISet<string> |
GetSingle(IDictionary<string, string>, string, float)
NOTE: This was getFloat() in Lucene
Declaration
protected float GetSingle(IDictionary<string, string> args, string name, float defaultVal)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name | |
| float | defaultVal |
Returns
| Type | Description |
|---|---|
| float |
GetSnowballWordSet(IResourceLoader, string, bool)
Same as GetWordSet(IResourceLoader, string, bool), except the input is in snowball format.
Declaration
protected CharArraySet GetSnowballWordSet(IResourceLoader loader, string wordFiles, bool ignoreCase)
Parameters
| Type | Name | Description |
|---|---|---|
| IResourceLoader | loader | |
| string | wordFiles | |
| bool | ignoreCase |
Returns
| Type | Description |
|---|---|
| CharArraySet |
GetWordSet(IResourceLoader, string, bool)
Returns as CharArraySet from wordFiles, which can be a comma-separated list of filenames
Declaration
protected CharArraySet GetWordSet(IResourceLoader loader, string wordFiles, bool ignoreCase)
Parameters
| Type | Name | Description |
|---|---|---|
| IResourceLoader | loader | |
| string | wordFiles | |
| bool | ignoreCase |
Returns
| Type | Description |
|---|---|
| CharArraySet |
Require(IDictionary<string, string>, string)
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public virtual string Require(IDictionary<string, string> args, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name |
Returns
| Type | Description |
|---|---|
| string |
Require(IDictionary<string, string>, string, ICollection<string>)
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public virtual string Require(IDictionary<string, string> args, string name, ICollection<string> allowedValues)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name | |
| ICollection<string> | allowedValues |
Returns
| Type | Description |
|---|---|
| string |
Require(IDictionary<string, string>, string, ICollection<string>, bool)
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public virtual string Require(IDictionary<string, string> args, string name, ICollection<string> allowedValues, bool caseSensitive)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name | |
| ICollection<string> | allowedValues | |
| bool | caseSensitive |
Returns
| Type | Description |
|---|---|
| string |
RequireBoolean(IDictionary<string, string>, string)
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
protected bool RequireBoolean(IDictionary<string, string> args, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name |
Returns
| Type | Description |
|---|---|
| bool |
RequireChar(IDictionary<string, string>, string)
Abstract parent class for analysis factories TokenizerFactory, TokenFilterFactory and CharFilterFactory.
The typical lifecycle for a factory consumer is:
- Create factory via its constructor (or via XXXFactory.ForName)
- (Optional) If the factory uses resources such as files, Inform(IResourceLoader) is called to initialize those resources.
- Consumer calls create() to obtain instances.
Declaration
public virtual char RequireChar(IDictionary<string, string> args, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name |
Returns
| Type | Description |
|---|---|
| char |
RequireInt32(IDictionary<string, string>, string)
NOTE: This was requireInt() in Lucene
Declaration
protected int RequireInt32(IDictionary<string, string> args, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name |
Returns
| Type | Description |
|---|---|
| int |
RequireSingle(IDictionary<string, string>, string)
NOTE: This was requireFloat() in Lucene
Declaration
protected float RequireSingle(IDictionary<string, string> args, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| IDictionary<string, string> | args | |
| string | name |
Returns
| Type | Description |
|---|---|
| float |
SplitFileNames(string)
Splits file names separated by comma character. File names can contain comma characters escaped by backslash ''
Declaration
protected IList<string> SplitFileNames(string fileNames)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileNames | the string containing file names |
Returns
| Type | Description |
|---|---|
| IList<string> | a list of file names with the escaping backslashed removed |