AhoCorasickMatch Struct
Definition
- Namespace
- Bodu.Collections.Generic.Trees
- Assembly
- Bodu.Collections.dll
- Package
- Bodu.Collections 1.0.0
- Source
- AhoCorasickMatch.cs
Represents a single pattern occurrence reported by EnumerateMatches(string).
public readonly struct AhoCorasickMatch : IEquatable<AhoCorasickMatch>
- Implements
- Inherited Members
- Extension Methods
Remarks
Matches are value-equatable: two matches are equal when they report the same pattern at the same start index.
Constructors
AhoCorasickMatch(string, int)
Represents a single pattern occurrence reported by EnumerateMatches(string).
public AhoCorasickMatch(string Pattern, int Start)
Parameters
PatternstringThe pattern that matched.
StartintThe zero-based index in the text at which the occurrence begins.
Remarks
Matches are value-equatable: two matches are equal when they report the same pattern at the same start index.
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
Methods
Deconstruct(out string, out int)
public void Deconstruct(out string Pattern, out int Start)
Parameters
Equals(AhoCorasickMatch)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(AhoCorasickMatch other)
Parameters
otherAhoCorasickMatchAn 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, AhoCorasickMatch)
public static bool operator ==(AhoCorasickMatch left, AhoCorasickMatch right)
Parameters
leftAhoCorasickMatchrightAhoCorasickMatch
Returns
operator !=(AhoCorasickMatch, AhoCorasickMatch)
public static bool operator !=(AhoCorasickMatch left, AhoCorasickMatch right)
Parameters
leftAhoCorasickMatchrightAhoCorasickMatch
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |