Class Rule
A phoneme rule.
Inherited Members
Namespace: Lucene.Net.Analysis.Phonetic.Language.Bm
Assembly: Lucene.Net.Analysis.Phonetic.dll
Syntax
public class Rule
  Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
Constructors
Rule(string, string, string, IPhonemeExpr)
Creates a new rule.
Declaration
public Rule(string pattern, string lContext, string rContext, IPhonemeExpr phoneme)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | pattern | The pattern.  | 
      
| string | lContext | The left context.  | 
      
| string | rContext | The right context.  | 
      
| IPhonemeExpr | phoneme | The resulting phoneme.  | 
      
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
Fields
ALL
A phoneme rule.
Declaration
public const string ALL = "ALL"
  Field Value
| Type | Description | 
|---|---|
| string | 
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
ALL_STRINGS_RMATCHER
A phoneme rule.
Declaration
public static readonly IRPattern ALL_STRINGS_RMATCHER
  Field Value
| Type | Description | 
|---|---|
| IRPattern | 
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
Properties
LContext
Gets the left context pattern. This is a regular expression that must match to the left of the pattern.
Declaration
public virtual IRPattern LContext { get; }
  Property Value
| Type | Description | 
|---|---|
| IRPattern | 
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
Pattern
Gets the pattern. This is a string-literal that must exactly match.
Declaration
public virtual string Pattern { get; }
  Property Value
| Type | Description | 
|---|---|
| string | 
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
Phoneme
Gets the phoneme. If the rule matches, this is the phoneme associated with the pattern match.
Declaration
public virtual IPhonemeExpr Phoneme { get; }
  Property Value
| Type | Description | 
|---|---|
| IPhonemeExpr | 
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
RContext
Gets the right context pattern. This is a regular expression that must match to the right of the pattern.
Declaration
public virtual IRPattern RContext { get; }
  Property Value
| Type | Description | 
|---|---|
| IRPattern | 
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
Methods
GetInstance(NameType, RuleType, LanguageSet)
Gets rules for a combination of name type, rule type and languages.
Declaration
public static IList<Rule> GetInstance(NameType nameType, RuleType rt, LanguageSet langs)
  Parameters
| Type | Name | Description | 
|---|---|---|
| NameType | nameType | The NameType to consider.  | 
      
| RuleType | rt | The RuleType to consider.  | 
      
| LanguageSet | langs | The set of languages to consider.  | 
      
Returns
| Type | Description | 
|---|---|
| IList<Rule> | A list of Rules that apply.  | 
      
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
GetInstance(NameType, RuleType, string)
Gets rules for a combination of name type, rule type and a single language.
Declaration
public static IList<Rule> GetInstance(NameType nameType, RuleType rt, string lang)
  Parameters
| Type | Name | Description | 
|---|---|---|
| NameType | nameType | The NameType to consider.  | 
      
| RuleType | rt | The RuleType to consider.  | 
      
| string | lang | The language to consider.  | 
      
Returns
| Type | Description | 
|---|---|
| IList<Rule> | A list of Rules that apply.  | 
      
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
GetInstanceMap(NameType, RuleType, LanguageSet)
Gets rules for a combination of name type, rule type and languages.
since 1.9Declaration
public static IDictionary<string, IList<Rule>> GetInstanceMap(NameType nameType, RuleType rt, LanguageSet langs)
  Parameters
| Type | Name | Description | 
|---|---|---|
| NameType | nameType | The NameType to consider.  | 
      
| RuleType | rt | The RuleType to consider.  | 
      
| LanguageSet | langs | The set of languages to consider.  | 
      
Returns
| Type | Description | 
|---|---|
| IDictionary<string, IList<Rule>> | A map containing all Rules that apply, grouped by the first character of the rule pattern.  | 
      
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
GetInstanceMap(NameType, RuleType, string)
Gets rules for a combination of name type, rule type and a single language.
since 1.9Declaration
public static IDictionary<string, IList<Rule>> GetInstanceMap(NameType nameType, RuleType rt, string lang)
  Parameters
| Type | Name | Description | 
|---|---|---|
| NameType | nameType | The NameType to consider.  | 
      
| RuleType | rt | The RuleType to consider.  | 
      
| string | lang | The language to consider.  | 
      
Returns
| Type | Description | 
|---|---|
| IDictionary<string, IList<Rule>> | A map containing all Rules that apply, grouped by the first character of the rule pattern.  | 
      
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
PatternAndContextMatches(ICharSequence, int)
Decides if the pattern and context match the input starting at a position. It is a match if the
LContext matches input up to i, Pattern matches at i and
RContext matches from the end of the match of Pattern to the end of input.
Declaration
public virtual bool PatternAndContextMatches(ICharSequence input, int i)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ICharSequence | input | The input J2N.Text.ICharSequence.  | 
      
| int | i | The int position within the input.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
  | 
      
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
PatternAndContextMatches(string, int)
Decides if the pattern and context match the input starting at a position. It is a match if the
LContext matches input up to i, Pattern matches at i and
RContext matches from the end of the match of Pattern to the end of input.
Declaration
public virtual bool PatternAndContextMatches(string input, int i)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | input | The input string.  | 
      
| int | i | The int position within the input.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
  | 
      
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. | 
PatternAndContextMatches(StringBuilder, int)
Decides if the pattern and context match the input starting at a position. It is a match if the
LContext matches input up to i, Pattern matches at i and
RContext matches from the end of the match of Pattern to the end of input.
Declaration
public virtual bool PatternAndContextMatches(StringBuilder input, int i)
  Parameters
| Type | Name | Description | 
|---|---|---|
| StringBuilder | input | The input StringBuilder.  | 
      
| int | i | The int position within the input.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | 
  | 
      
Remarks
Rules have a pattern, left context, right context, output phoneme, set of languages for which they apply and a logical flag indicating if all languages must be in play. A rule matches if:
- the pattern matches at the current position
 - the string up until the beginning of the pattern matches the left context
 - the string from the end of the pattern matches the right context
 - logical is ALL and all languages are in scope; or
 - logical is any other value and at least one language is in scope
 
Lucene.Net.Analysis.Phonetic.Language.Bm.NameType_RuleType_[language].txt
The format of these resources is the following:
| Rules: | 
            whitespace separated, double-quoted strings. There should be 4 columns to each row, and these
            will be interpreted as:
            
  | 
| End-of-line comments: | Any occurrence of '//' will cause all text following on that line to be discarded as a comment. | 
| Multi-line comments: | Any line starting with '/*' will start multi-line commenting mode. This will skip all content until a line ending in '*' and '/' is found. | 
| Blank lines: | All blank lines will be skipped. |