Ejemplo n.º 1
0
		protected internal override Boolean IsNeglectHeader(ReadOnlySpan<Char> source, Int32 location) => true; // The first char could always be the edit, so this is always true.

		/// <inheritdoc/>
		protected internal override void Neglect(ReadOnlySpan<Char> source, ref Int32 location, [AllowNull, MaybeNull] out Exception exception, [AllowNull] IAdd<Capture> trace) {
			if (location + String.Length > source.Length) {
				exception = AtEnd;
				trace?.Add(exception, location);
			} else if (EditDistance.Hamming(String, source.Slice(location, String.Length), Casing) > MaxEdits) {
				trace?.Add(source.Slice(location, String.Length), location);
				location += String.Length;
				exception = null;
			} else {
				exception = NoMatch;
				trace?.Add(exception, location);
			}
		}