public class GoogleNGramsSQLBacked
extends java.lang.Object
| Constructor and Description |
|---|
GoogleNGramsSQLBacked() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeConnection() |
static boolean |
existsTable(java.lang.String tablename) |
static int |
get1GramRank(java.lang.String str)
Return rank of 1 gram in google ngeams if it is less than 20k.
|
static long |
getCount(java.lang.String str)
Queries the SQL tables for the count of the phrase.
|
static java.util.List<Pair<java.lang.String,java.lang.Long>> |
getCounts(java.util.Collection<java.lang.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(java.lang.String[] args) |
static void |
populateTablesInSQL(java.lang.String dir,
java.util.Collection<java.lang.Integer> typesOfPhrases) |
static void |
setDBName(java.lang.String DBName) |
public static boolean existsTable(java.lang.String tablename)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static long getCount(java.lang.String str)
str - : phrasejava.sql.SQLExceptionpublic static java.util.List<Pair<java.lang.String,java.lang.Long>> getCounts(java.util.Collection<java.lang.String> strs) throws java.sql.SQLException
java.sql.SQLExceptionpublic static void populateTablesInSQL(java.lang.String dir,
java.util.Collection<java.lang.Integer> typesOfPhrases)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static int getTotalCount(int ngram)
public static int get1GramRank(java.lang.String str)
public static void closeConnection()
throws java.sql.SQLException
java.sql.SQLExceptionpublic static void main(java.lang.String[] args)
public static void setDBName(java.lang.String DBName)