@Test public void testGetTopContextAtBeginningAndEnd() throws Exception { assertArrayEquals(new String[] { "bar", "boo" }, Server.getTopContextAtBeginningAndEnd(db, DatabaseService.PPMI_TABLE, CORPUS, "foo")); }
static final String[] getTopContextAtBeginningAndEnd(final DatabaseService db, final String table, final String corpus, final String word) throws Exception { final Set<String> topContext = new HashSet<>(); topContext.addAll(db.getTopContextWordsInYear(corpus, table, word, db.getFirstYear(corpus, word), LIMIT)); topContext.addAll(db.getTopContextWordsInYear(corpus, table, word, db.getLastYear(corpus, word), LIMIT)); return topContext.toArray(new String[topContext.size()]); }
Server { static final String[] getTopContextAtBeginningAndEnd(final DatabaseService db, final String table, final String corpus, final String word) throws Exception { final Set<String> topContext = new HashSet<>(); topContext.addAll(db.getTopContextWordsInYear(corpus, table, word, db.getFirstYear(corpus, word), LIMIT)); topContext.addAll(db.getTopContextWordsInYear(corpus, table, word, db.getLastYear(corpus, word), LIMIT)); return topContext.toArray(new String[topContext.size()]); } }
Server { static final String[] getTopContextAtBeginningAndEnd(final DatabaseService db, final String table, final String corpus, final String word) throws Exception { final Set<String> topContext = new HashSet<>(); topContext.addAll(db.getTopContextWordsInYear(corpus, table, word, db.getFirstYear(corpus, word), LIMIT)); topContext.addAll(db.getTopContextWordsInYear(corpus, table, word, db.getLastYear(corpus, word), LIMIT)); return topContext.toArray(new String[topContext.size()]); }  }
Server { static final String[] getTopContextAtBeginningAndEnd(final DatabaseService db, final String table, final String corpus, final String word) throws Exception { final Set<String> topContext = new HashSet<>(); topContext.addAll(db.getTopContextWordsInYear(corpus, table, word, db.getFirstYear(corpus, word), LIMIT)); topContext.addAll(db.getTopContextWordsInYear(corpus, table, word, db.getLastYear(corpus, word), LIMIT)); return topContext.toArray(new String[topContext.size()]); }  static void startErrorServer(final Configuration config, final ArrayList<String> messageParts); static void startServer(final DatabaseService db, final Configuration config, boolean onlyExternal); static void stopServer(); }
Server { static final String[] getTopContextAtBeginningAndEnd(final DatabaseService db, final String table, final String corpus, final String word) throws Exception { final Set<String> topContext = new HashSet<>(); topContext.addAll(db.getTopContextWordsInYear(corpus, table, word, db.getFirstYear(corpus, word), LIMIT)); topContext.addAll(db.getTopContextWordsInYear(corpus, table, word, db.getLastYear(corpus, word), LIMIT)); return topContext.toArray(new String[topContext.size()]); }  static void startErrorServer(final Configuration config, final ArrayList<String> messageParts); static void startServer(final DatabaseService db, final Configuration config, boolean onlyExternal); static void stopServer();  }