public class GoogleNGramsSQLBacked extends Object
| Constructor and Description |
|---|
GoogleNGramsSQLBacked() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeConnection() |
static boolean |
existsTable(String tablename) |
static long |
getCount(String str)
Queries the SQL tables for the count of the phrase.
|
static List<Pair<String,Long>> |
getCounts(Collection<String> strs) |
static int |
getTotalCount(int ngram)
Note that this is really really slow for ngram > 1
TODO: make this fast (if we had been using mysql we could have)
|
static void |
main(String[] args) |
static void |
populateTablesInSQL(String dir,
Collection<Integer> typesOfPhrases) |
public static boolean existsTable(String tablename) throws SQLException
SQLExceptionpublic static long getCount(String str)
str - : phraseSQLExceptionpublic static List<Pair<String,Long>> getCounts(Collection<String> strs) throws SQLException
SQLExceptionpublic static void populateTablesInSQL(String dir, Collection<Integer> typesOfPhrases) throws SQLException
SQLExceptionpublic static int getTotalCount(int ngram)
public static void closeConnection()
throws SQLException
SQLExceptionpublic static void main(String[] args)