Class SuffixAgainstPatternComparer
An
Inheritance
Namespace: MoreStructures.BurrowsWheelerTransform.Matching.Comparers
Assembly: MoreStructures.dll
Syntax
public abstract class SuffixAgainstPatternComparer : IComparer<int>
Constructors
| Improve this Doc View SourceSuffixAgainstPatternComparer(TextWithTerminator, IEnumerable<Char>)
Declaration
protected SuffixAgainstPatternComparer(TextWithTerminator text, IEnumerable<char> pattern)
Parameters
Type | Name | Description |
---|---|---|
TextWithTerminator | text | |
IEnumerable<System.Char> | pattern |
Properties
| Improve this Doc View SourceCharComparer
The
Declaration
public IComparer<char> CharComparer { get; }
Property Value
Type | Description |
---|---|
IComparer<System.Char> |
LongestMatch
The maximum amount of chars of the pattern matched, since the instantiation of this comparer.
Declaration
public int LongestMatch { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
It is never reset. To start over, a new instance of this comparer has to be created.
LongestMatchFirstValue
The value of the first term of comparison, which resulted in LongestMatch chars matched, when comparing the suffix starting at LongestMatchFirstValue against the pattern.
Declaration
public int LongestMatchFirstValue { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
If multiple values of the first term resulted in the same amount of chars matched, the first value encountered is kept.
Pattern
The pattern, to compare against each suffix of Text.
Declaration
public IEnumerable<char> Pattern { get; }
Property Value
Type | Description |
---|---|
IEnumerable<System.Char> |
Text
The text, to extract suffixes from.
Declaration
public TextWithTerminator Text { get; }
Property Value
Type | Description |
---|---|
TextWithTerminator |
Methods
| Improve this Doc View SourceCompare(Int32, Int32)
Compares the suffix of text identified by x
against the pattern.
Declaration
public abstract int Compare(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The index, in the complete Suffix Array, of the suffix which is first term of comparison. |
System.Int32 | y | Ignored. |
Returns
Type | Description |
---|---|
System.Int32 | A positive value if there is mismatch and the suffix is bigger than the pattern lexicographically.
|
CompareSuffixAgainstPattern(Int32, Int32)
Compares the suffix of Text starting at index suffixStartIndex
against
Pattern, returning the result of the comparison as a positive, null or negative
System.Int32.
Declaration
protected virtual int CompareSuffixAgainstPattern(int bwtIndex, int suffixStartIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | bwtIndex | The index, in the Burrows-Wheeler Transform, of the first char of the suffix starting at
|
System.Int32 | suffixStartIndex | The index of Text where |
Returns
Type | Description |
---|---|
System.Int32 | A positive System.Int32, if the suffix is lexicographically bigger than Pattern.
|