@Test public void testGetYearAndFrequency() throws Exception { assertEquals(Arrays.asList(new YearAndValue[] { new YearAndValue(1910, 0.6f), new YearAndValue(1920, 0.1f), new YearAndValue(1930, 0.3f), new YearAndValue(1940, 0.5f) }), db.getYearAndFrequency(CORPUS, "foo")); }
List<YearAndValue> getYearAndFrequency(final int corpus, final int wordId) throws Exception { try (Connection con = sql2o.open()) { return con.createQuery(FREQUENCY_QUERY) .addParameter("corpus", corpus).addParameter("word", wordId) .executeAndFetch(YearAndValue.class); } }
DatabaseService { List<YearAndValue> getYearAndFrequency(final int corpus, final int wordId) throws Exception { try (Connection con = sql2o.open()) { return con.createQuery(FREQUENCY_QUERY) .addParameter("corpus", corpus).addParameter("word", wordId) .executeAndFetch(YearAndValue.class); } } }
DatabaseService { List<YearAndValue> getYearAndFrequency(final int corpus, final int wordId) throws Exception { try (Connection con = sql2o.open()) { return con.createQuery(FREQUENCY_QUERY) .addParameter("corpus", corpus).addParameter("word", wordId) .executeAndFetch(YearAndValue.class); } } DatabaseService(final Sql2o sql2o, final Configuration config); }
DatabaseService { List<YearAndValue> getYearAndFrequency(final int corpus, final int wordId) throws Exception { try (Connection con = sql2o.open()) { return con.createQuery(FREQUENCY_QUERY) .addParameter("corpus", corpus).addParameter("word", wordId) .executeAndFetch(YearAndValue.class); } } DatabaseService(final Sql2o sql2o, final Configuration config); static void importTables(final Configuration config,
			final Sql2o sql2o); static void initializeTables(final Sql2o sql2o); void dropAll(); String getCorpusLink(final String corpus, final String word); String getCorpusName(final String corpus); String getCorpusNote(final String corpus); Map<Integer, Embedding> getEmbedding(final String corpusName,
			final String word); Map<String, List<YearAndValue>> getEmotion(final String corpusName,
			final String word); Integer getFirstYear(final String corpusName, final String word); Integer getLastYear(final String corpusName, final String word); List<YearAndValue> getSimilarity(final String corpusName,
			final String word1, final String word2); List<String> getTopContextWordsInYear(final String corpusName,
			final String table, final String word, final Integer year,
			final int limit); List<YearAndValue> getYearAndAssociation(final String corpusName,
			final String tableName, final String word1, final String word2); List<YearAndValue> getYearAndFrequency(final String corpusName,
			final String word); boolean knowCorpus(final String corpus); boolean wordInCorpus(final String word, final String corpus); }
DatabaseService { List<YearAndValue> getYearAndFrequency(final int corpus, final int wordId) throws Exception { try (Connection con = sql2o.open()) { return con.createQuery(FREQUENCY_QUERY) .addParameter("corpus", corpus).addParameter("word", wordId) .executeAndFetch(YearAndValue.class); } } DatabaseService(final Sql2o sql2o, final Configuration config); static void importTables(final Configuration config,
			final Sql2o sql2o); static void initializeTables(final Sql2o sql2o); void dropAll(); String getCorpusLink(final String corpus, final String word); String getCorpusName(final String corpus); String getCorpusNote(final String corpus); Map<Integer, Embedding> getEmbedding(final String corpusName,
			final String word); Map<String, List<YearAndValue>> getEmotion(final String corpusName,
			final String word); Integer getFirstYear(final String corpusName, final String word); Integer getLastYear(final String corpusName, final String word); List<YearAndValue> getSimilarity(final String corpusName,
			final String word1, final String word2); List<String> getTopContextWordsInYear(final String corpusName,
			final String table, final String word, final Integer year,
			final int limit); List<YearAndValue> getYearAndAssociation(final String corpusName,
			final String tableName, final String word1, final String word2); List<YearAndValue> getYearAndFrequency(final String corpusName,
			final String word); boolean knowCorpus(final String corpus); boolean wordInCorpus(final String word, final String corpus); static final String SIMILARITY_TABLE; static final String EMOTION_TABLE; static final String PPMI_TABLE; static final String EMBEDDING_TABLE; static final String CHI_TABLE; final Map<String, Corpus> corpora; }