private void buildLookupTable(){
  final Set<Integer> seen_child_ids=new HashSet<>();
  Trie previous_trie=null;
  boolean first=true;
  for (  final Trie trie : this.tries) {
    if (!first) {
      if (!haveSameSourceSide(previous_trie,trie) || !haveSameArity(previous_trie,trie)) {
        throw new RuntimeException("SliceAggregatingTrie's subtries differ in sourceSide or arity. Was the text grammar sorted insufficiently?");
      }
    }
 else {
      first=false;
    }
    previous_trie=trie;
    if (trie.hasRules()) {
      if (trieWithRules != null) {
        throw new RuntimeException("SliceAggregatingTrie can only have one subtrie with rules. Was the text grammar sorted insufficiently?");
      }
      trieWithRules=trie;
    }
    final HashMap<Integer,? extends Trie> children=trie.getChildren();
    for (    int id : children.keySet()) {
      if (seen_child_ids.contains(id)) {
        throw new RuntimeException("SliceAggregatingTrie's subtries contain non-disjoint child words. Was the text grammar sorted insufficiently?");
      }
      seen_child_ids.add(id);
      lookup.put(id,children.get(id));
    }
  }
}

private void buildLookupTable ( ) { final Set < Integer > seen_child_ids = new HashSet < > ( ) ; Trie previous_trie = null ; boolean first = true ; for ( final Trie trie : this . tries ) { if ( ! first ) { if ( ! haveSameSourceSide ( previous_trie , trie ) || ! haveSameArity ( previous_trie , trie ) ) { throw new RuntimeException ( "SliceAggregatingTrie's subtries differ in sourceSide or arity. Was the text grammar sorted insufficiently?" ) ; } } else { first = false ; } previous_trie = trie ; if ( trie . hasRules ( ) ) { if ( trieWithRules != null ) { throw new RuntimeException ( "SliceAggregatingTrie can only have one subtrie with rules. Was the text grammar sorted insufficiently?" ) ; } trieWithRules = trie ; } final HashMap < Integer , ? extends Trie > children = trie . getChildren ( ) ; for ( int id : children . keySet ( ) ) { if ( seen_child_ids . contains ( id ) ) { throw new RuntimeException ( "SliceAggregatingTrie's subtries contain non-disjoint child words. Was the text grammar sorted insufficiently?" ) ; } seen_child_ids . add ( id ) ; lookup . put ( id , children . get ( id ) ) ; } } }
fills the lookup table for child nodes . also performs various checks to ensure correctness of the packedtrie aggregation .
