code: public void findPatterns() 
          throws Exception {
          HashSet<String> patterns = new HashSet<String>();
          for (String phrase : filtered_phrases) {
              String phrase_arr[] = phrase.split(":");
              String A = phrase_arr[0];
              String B = phrase_arr[1];
              //System.err.println(A + ": " + B);
  
              patterns.addAll(searchDirectoryForPattern(new File(DATA_DIR), A, B));
          }
          Iterator iter = patterns.iterator();
          while (iter.hasNext()) {
              String curr_pattern_str = (String)iter.next();
              String[] curr_pattern = curr_pattern_str.split("\\s");
              int curr_length = curr_pattern.length;
              //System.err.println("length of pattern: " + curr_length);
              //do a for loop with all combinatorials of wildcard patterns
              //for each iteration do a wildcard search
              for (int comb = 0; comb < (int)Math.pow(2.0,(double)curr_length); comb++) {
                  String comb_pattern = "\\s" + combinatorialPatternMaker(curr_pattern, curr_length, comb);
                  try {
                      int score = countWildcardPhraseFrequencies(new File(DATA_DIR), ".*" + comb_pattern + ".*");
                      InterveningWordsPattern db_pattern = new InterveningWordsPattern(comb_pattern);
                      db_pattern.setOccurrences(score);
                      pattern_list.put(db_pattern, score); //insert the pattern into database (only if it has a high enough score)
  
                      //System.err.println(comb_pattern + ": " + score);
                  } catch (Exception e) {
                      System.err.println("could not perform wildcard search");
                  }
              }
          }
      }
docs: Finds patterns using the filtered phrases.  Should be called after {@link
  #filterPhrases(String,String,Syntex[],Synset[]) filterPhrases}.