public static float countPhraseFrequencies(String indexDir, String A, String B) {
        File indexDir_f = new File(indexDir);

        if (!indexDir_f.exists() || !indexDir_f.isDirectory()) {
            System.err.println("Search failed: index directory does not exist");
        } else {
            try {
                return searchPhrase(indexDir_f, A, B);
            } catch (Exception e) {
                System.err.println("Unable to search "+indexDir);
                return 0;
            }
        }
        return 0;
    }
public static float countPhraseFrequencies ( String indexDir , String A , String B ) { File indexDir_f = new File ( indexDir ) ; if ( ! indexDir_f . exists ( ) || ! indexDir_f . isDirectory ( ) ) { System . err . println ( "Search failed: index directory does not exist" ) ; } else { try { return searchPhrase ( indexDir_f , A , B ) ; } catch ( Exception e ) { System . err . println ( "Unable to search " + indexDir ) ; return 0 ; } } return 0 ; }
Searches an index given the index directory and counts up the frequncy of the two words used in a phrase.

@param indexDir a String containing the directory where the index is stored
@param A a {@code String} containing the first word of the phrase
@param B a {@code String} containing the last word of the phrase
@return float