LOG.log(MessageLogLevel.INFO, "storing synsets");
int count = 0;
while (itr.hasNext()) {
if (count++ % 1000 == 0)
System.out.println("synset: " + count);
Synset synset = (Synset) itr.next();
int id = nextId();
synsetOffsetToId.put(new Long(synset.getOffset()), new Integer(id));
synsetStmt.setInt(1, id);
synsetStmt.setLong(2, synset.getOffset());
synsetStmt.setString(3, synset.getPOS().getKey());
synsetStmt.setBoolean(4, synset.isAdjectiveCluster());
synsetStmt.setString(5, synset.getGloss());
synsetStmt.execute();
Word words[] = synset.getWords();
synsetWordStmt.setInt(2, id);
synsetVerbFrameStmt.setInt(2, id);
for (int i = 0; i < words.length; i++) {
int wordId = nextId();
synsetWordStmt.setInt(1, wordId);
synsetWordStmt.setString(3, words[i].getLemma());
synsetWordStmt.setInt(4, words[i].getIndex());
synsetWordStmt.execute();
if (!(words[i] instanceof Verb))
continue;
synsetVerbFrameStmt.setInt(4, words[i].getIndex());
int flags[] = ((Verb) words[i]).getVerbFrameIndicies();
for (int j = 0; j < flags.length; j++) {
synsetVerbFrameStmt.setInt(1, nextId());
synsetVerbFrameStmt.setInt(3, flags[j]);
synsetVerbFrameStmt.execute();
}
}
Pointer pointers[] = synset.getPointers();
synsetPointerStmt.setInt(2, id);
int i = 0;
while (i < pointers.length) {
synsetPointerStmt.setInt(1, nextId());
synsetPointerStmt.setString(3, pointers[i].getType().getKey());