Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
EditScript.cs
1using System.Collections;
2using System.Collections.Generic;
3
4namespace Waher.Runtime.Text
5{
10 public class EditScript<T> : IEnumerable<Step<T>>
11 {
12 private readonly Step<T>[] steps;
13 private readonly T[] s1;
14 private readonly T[] s2;
15
22 public EditScript(T[] S1, T[] S2, Step<T>[] Steps)
23 {
24 this.s1 = S1;
25 this.s2 = S2;
26 this.steps = Steps;
27 }
28
32 public Step<T>[] Steps => this.steps;
33
37 public T[] S1 => this.s1;
38
42 public T[] S2 => this.s2;
43
48 public IEnumerator<Step<T>> GetEnumerator()
49 {
50 IEnumerable<Step<T>> Temp = this.steps;
51 return Temp.GetEnumerator();
52 }
53
58 IEnumerator IEnumerable.GetEnumerator()
59 {
60 return this.steps.GetEnumerator();
61 }
62 }
63}
Represents an Edit-script, converting one sequence of symbols to another.
Definition: EditScript.cs:11
Step< T >[] Steps
Steps making up how to transform S1 to S2.
Definition: EditScript.cs:32
IEnumerator< Step< T > > GetEnumerator()
IEnumerable<T>.GetEnumerator
Definition: EditScript.cs:48
EditScript(T[] S1, T[] S2, Step< T >[] Steps)
Represents an Edit-script, converting one sequence of symbols to another.
Definition: EditScript.cs:22
T[] S2
Second sequence of symbols.
Definition: EditScript.cs:42
T[] S1
First sequence of symbols.
Definition: EditScript.cs:37
Represents a sub-sequence of symbols.
Definition: Step.cs:12