AhoCorasickMatch<TValue> Struct
Definition
- Namespace
- Bodu.Collections.Generic.Trees
- Assembly
- Bodu.Collections.dll
- Package
- Bodu.Collections 1.0.0
- Source
- AhoCorasickMatch{T}.cs
Represents a single pattern occurrence reported by EnumerateMatches(string), carrying the value associated with the matched pattern.
public readonly struct AhoCorasickMatch<TValue> : IEquatable<AhoCorasickMatch<TValue>>
Type Parameters
TValueThe type of the value associated with each pattern.
- Implements
-
IEquatable<AhoCorasickMatch<TValue>>
- Inherited Members
- Extension Methods
Remarks
Matches are value-equatable: two matches are equal when they report the same pattern, start index, and value.
Constructors
AhoCorasickMatch(string, int, TValue)
Represents a single pattern occurrence reported by EnumerateMatches(string), carrying the value associated with the matched pattern.
public AhoCorasickMatch(string Pattern, int Start, TValue Value)
Parameters
PatternstringThe pattern that matched.
StartintThe zero-based index in the text at which the occurrence begins.
ValueTValueThe value associated with the matched pattern.
Remarks
Matches are value-equatable: two matches are equal when they report the same pattern, start index, and value.
Properties
End
Gets the exclusive zero-based end index of the occurrence.
public int End { get; }
Property Value
Pattern
The pattern that matched.
public string Pattern { get; init; }
Property Value
Start
The zero-based index in the text at which the occurrence begins.
public int Start { get; init; }
Property Value
Value
The value associated with the matched pattern.
public TValue Value { get; init; }
Property Value
- TValue
Methods
Deconstruct(out string, out int, out TValue)
public void Deconstruct(out string Pattern, out int Start, out TValue Value)
Parameters
Equals(AhoCorasickMatch<TValue>)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(AhoCorasickMatch<TValue> other)
Parameters
otherAhoCorasickMatch<TValue>An object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(AhoCorasickMatch<TValue>, AhoCorasickMatch<TValue>)
public static bool operator ==(AhoCorasickMatch<TValue> left, AhoCorasickMatch<TValue> right)
Parameters
leftAhoCorasickMatch<TValue>rightAhoCorasickMatch<TValue>
Returns
operator !=(AhoCorasickMatch<TValue>, AhoCorasickMatch<TValue>)
public static bool operator !=(AhoCorasickMatch<TValue> left, AhoCorasickMatch<TValue> right)
Parameters
leftAhoCorasickMatch<TValue>rightAhoCorasickMatch<TValue>
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |