public void process(int start, int end, Node node)
  {
    node.leaves.add(leaf);
    node.count++;
    for (int i = 0; i < node.children.size(); i++)
    {
      if (input.substring(start, end).startsWith(
          input.substring(node.children.get(i).stringStart,
              node.children.get(i).stringEnd)))
      {
        process(
            start
                + (node.children.get(i).stringEnd - node.children.get(i).stringStart),
            end, node.children.get(i));
        return;
      }
      int match = stringMatch(start, end, node.children.get(i).stringStart);
      if (match > 0)
      {
        splitTree(match, start, end, node, node.children.get(i));
        return;
      }
    }
    // no match
    Node newNode = new Node(start, end, leaf++);
    node.addChild(newNode);
    nodes.add(newNode);
  }