<commit_before>digraph G {
  charset="UTF-8";
  graph [truecolor=true,bgcolor=transparent];
  root [label="",shape=circle];
  rankdir="<%= @direction -%>";

  <%- @graph.tokens.select { |t| t.empty_token_sort != 'P' }.each do |token| -%>
    <%= node token.id, token.relation.to_s.upcase,                 shape: :box -%>

    <%- if token.relation -%>
      <%= edge (token.head ? token.head.id : :root), token.id, '', weight: 1.0, color: :orange -%>
    <%- end -%>

    <%- token.slashes.each do |(relation, target)| -%>
      <%= edge token.id, target, relation.to_s.upcase, weight: 0.0, color: :blue, style: :dashed %>
    <%- end -%>
  <%- end -%>  

  <%- @graph.tokens.select { |t| t.empty_token_sort != 'P' }.each do |token| -%>
    <%= edge token.id, "T#{token.id}", nil, weight: 10, arrowhead: :none -%>
  <%- end -%>  

  {
    rank="same";

    <%- @graph.tokens.select { |t| t.empty_token_sort != 'P' }.each do |token| -%>
      <%= node "T#{token.id}", token.form, shape: :none -%>
    <%- end -%>  
  }
}<commit_msg>Enforce linear order in "modern" viz<commit_after>digraph G {
  charset="UTF-8";
  graph [truecolor=true,bgcolor=transparent];
  root [label="",shape=circle];
  rankdir="<%= @direction -%>";

  <%- @graph.tokens.select { |t| t.empty_token_sort != 'P' }.each do |token| -%>
    <%= node token.id, token.relation.to_s.upcase,                 shape: :box -%>

    <%- if token.relation -%>
      <%= edge (token.head ? token.head.id : :root), token.id, '', weight: 1.0, color: :orange -%>
    <%- end -%>

    <%- token.slashes.each do |(relation, target)| -%>
      <%= edge token.id, target, relation.to_s.upcase, weight: 0.0, color: :blue, style: :dashed %>
    <%- end -%>
  <%- end -%>  

  <%- @graph.tokens.select { |t| t.empty_token_sort != 'P' }.each do |token| -%>
    <%= edge token.id, "T#{token.id}", nil, weight: 10, arrowhead: :none -%>
  <%- end -%>  

  {
    rank="same";

    <%- @graph.tokens.select { |t| t.empty_token_sort != 'P' }.each do |token| -%>
      <%= node "T#{token.id}", token.form, shape: :none -%>
    <%- end -%>  

    <%= @graph.tokens.select { |t| t.empty_token_sort != 'P' }.map { |token| "T#{token.id}" }.join('->') -%> [style="invis"];
  }
}
{'fraction_non_alphanumeric': 0.24502712477396021, 'fraction_numerical': 0.006329113924050633, 'mean_word_length': 2.7068676716917923, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4732811', 'n_tokens_mistral': 937, 'n_tokens_neox': 876, 'n_words': 172}