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 .