public static Automaton toAutomaton(boolean preserveSep,Iterable<ContextQuery> queries){
  Automaton a=Automata.makeEmptyString();
  Automaton gap=Automata.makeChar(ContextMapping.SEPARATOR);
  if (preserveSep) {
    gap=Operations.concatenate(gap,Automata.makeChar(XAnalyzingSuggester.SEP_LABEL));
  }
  for (  ContextQuery query : queries) {
    a=Operations.concatenate(Arrays.asList(query.toAutomaton(),gap,a));
  }
  return Operations.determinize(a,Integer.MAX_VALUE);
}

public static Automaton toAutomaton ( boolean preserveSep , Iterable < ContextQuery > queries ) { Automaton a = Automata . makeEmptyString ( ) ; Automaton gap = Automata . makeChar ( ContextMapping . SEPARATOR ) ; if ( preserveSep ) { gap = Operations . concatenate ( gap , Automata . makeChar ( XAnalyzingSuggester . SEP_LABEL ) ) ; } for ( ContextQuery query : queries ) { a = Operations . concatenate ( Arrays . asList ( query . toAutomaton ( ) , gap , a ) ) ; } return Operations . determinize ( a , Integer . MAX_VALUE ) ; }
create a automaton for a given context query this automaton will be used to find the matching paths with the fst
