code: private void createMissingSpanningRelations(SDocumentGraph graph,
      FastInverseMap<Long, SNode> nodeByRankID,
      TreeMap<Long, SToken> tokenByIndex,
      Map<String, ComponentEntry> componentForSpan,
      AtomicInteger numberOfRelations)
    {
  
      // add the missing spanning relations for each continuous span of the graph
      for (SSpan span : graph.getSpans())
      {
        long pre=1;
        RelannisNodeFeature featSpan = RelannisNodeFeature.extract(span);      
        ComponentEntry spanComponent = componentForSpan.get(span.getId());
        if (spanComponent != null && featSpan != null 
          && featSpan.getLeftToken() >= 0 && featSpan.getRightToken() >= 0)
        {
          for (long i = featSpan.getLeftToken(); i <= featSpan.getRightToken();
            i++)
          {
            SToken tok = tokenByIndex.get(i);
            if (tok != null)
            {
              boolean missing = true;
              List<SRelation<SNode, SNode>> existingRelations = graph.getRelations(span.getId(),
                tok.getId());
              if (existingRelations != null)
              {
                for (Relation e : existingRelations)
                {
                  if (e instanceof SSpanningRelation)
                  {
                    missing = false;
                    break;
                  }
                }
              } // end if relations exist
  
              if (missing)
              {
                String type = "c";
  
                SLayer layer
                  = findOrAddSLayer(spanComponent.getNamespace(), graph);
  
                createNewRelation(graph, span, tok, null, type,
                  spanComponent.getId(), layer,
                  pre++, nodeByRankID, numberOfRelations);
              }
            } // end if token exists
          } // end for each covered token index
        }
      } // end for each span
    }
docs: Use the left/right token index of the spans to create spanning relations
  when this did not happen yet.
  
  @param graph
  @param nodeByRankID
  @param numberOfRelations