Ejemplo n.º 1
0
 public StringData(SpanFactory <int> spanFactory, string str)
 {
     _spanFactory = spanFactory;
     _str         = new StringBuilder(str);
     _span        = _spanFactory.Create(0, _str.Length);
     _annotations = new AnnotationList <int>(spanFactory);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 public ShapeNode(SpanFactory <ShapeNode> spanFactory, FeatureStruct fs)
 {
     _spanFactory = spanFactory;
     _ann         = new Annotation <ShapeNode>(spanFactory.Create(this), fs);
     Tag          = int.MinValue;
 }
Ejemplo n.º 4
0
 public bool Overlaps(TOffset start, TOffset end, Direction dir)
 {
     return(Overlaps(_spanFactory.Create(start, end, dir)));
 }
Ejemplo n.º 5
0
 public Span <ShapeNode> CopyTo(ShapeNode srcStart, ShapeNode srcEnd, Shape dest)
 {
     return(CopyTo(_spanFactory.Create(srcStart, srcEnd), dest));
 }