public class DictionaryToDatabase
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.sql.Connection |
connection
The database connection.
|
private java.util.Map |
idToSynsetOffset
Mapping of database id's to synset offset id's.
|
private static int |
INTERNAL_ID |
private static MessageLog |
LOG
Our message log.
|
private java.util.Map |
synsetOffsetToId
Mapping of synset offset id's to database id's.
|
private static long |
TIME |
| Constructor and Description |
|---|
DictionaryToDatabase(java.sql.Connection conn)
Create a new DictionaryToDatabase with a database connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
createTables(java.lang.String scriptFilePath)
Create the database tables.
|
void |
insertData()
Inserts the data into the database.
|
static void |
main(java.lang.String[] args)
Run the program, requires 4 arguments.
|
private static int |
nextId() |
private void |
storeExceptions(java.util.Iterator itr)
Store the exceptions file.
|
private void |
storeIndexWords(java.util.Iterator itr)
Store all the index words.
|
private void |
storeIndexWordSynsets()
Store the index word synsets.
|
private void |
storeSynsets(java.util.Iterator itr)
Store all of the synsets in the database.
|
private static final MessageLog LOG
private static int INTERNAL_ID
private static long TIME
private java.sql.Connection connection
private java.util.Map idToSynsetOffset
private java.util.Map synsetOffsetToId
public DictionaryToDatabase(java.sql.Connection conn)
conn - - the database connectionpublic static void main(java.lang.String[] args)
args - private static int nextId()
public void createTables(java.lang.String scriptFilePath)
throws java.io.IOException,
java.sql.SQLException
scriptFilePath - - the sql script filenamejava.io.IOExceptionjava.sql.SQLExceptionpublic void insertData()
throws java.lang.Exception
java.lang.Exceptionprivate void storeIndexWords(java.util.Iterator itr)
throws java.sql.SQLException
itr - - the part of speech iteratorjava.sql.SQLExceptionprivate void storeSynsets(java.util.Iterator itr)
throws java.sql.SQLException
itr - java.sql.SQLExceptionprivate void storeIndexWordSynsets()
throws java.sql.SQLException
java.sql.SQLExceptionprivate void storeExceptions(java.util.Iterator itr)
throws java.sql.SQLException
itr - java.sql.SQLException