public AHO_CORASICK(String tokens) {
        searcher = new AhoCorasick<String>();
        for ( String block : tokens.split(";") ) {
            //block is of the form "dogs=[terrier|retriever|pit bull]"
            String[] resultAndNeedles = block.split("=");
            String result = resultAndNeedles[0];
            String bracketedNeedles = resultAndNeedles[1];
            //remove leading and trailing brackets from needles
            String needles = bracketedNeedles.substring(1, bracketedNeedles.length()-1);
            for ( String needle : needles.split("\\|")) {
                searcher.add(needle.getBytes(UTF8), result);
            }
        }
        searcher.prepare();
    }