public StringData(SpanFactory <int> spanFactory, string str) { _spanFactory = spanFactory; _str = new StringBuilder(str); _span = _spanFactory.Create(0, _str.Length); _annotations = new AnnotationList <int>(spanFactory); }
public void Insert(int index, string str) { _str.Insert(index, str); foreach (Annotation <int> ann in _annotations) { foreach (Annotation <int> a in ann.GetNodesDepthFirst()) { if (a.Span.Start >= index) { a.Span = _spanFactory.Create(a.Span.Start + str.Length, a.Span.End + str.Length); } else if (a.Span.End > index) { a.Span = _spanFactory.Create(a.Span.Start, a.Span.End + str.Length); } } } _span = _spanFactory.Create(0, _str.Length); }
public ShapeNode(SpanFactory <ShapeNode> spanFactory, FeatureStruct fs) { _spanFactory = spanFactory; _ann = new Annotation <ShapeNode>(spanFactory.Create(this), fs); Tag = int.MinValue; }
public bool Overlaps(TOffset start, TOffset end, Direction dir) { return(Overlaps(_spanFactory.Create(start, end, dir))); }
public Span <ShapeNode> CopyTo(ShapeNode srcStart, ShapeNode srcEnd, Shape dest) { return(CopyTo(_spanFactory.Create(srcStart, srcEnd), dest)); }