|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.extjwnl.utilities.DictionaryToDatabase
public class DictionaryToDatabase
DictionaryToDatabase is used to transfer a WordNet file database into an actual database structure.
Field Summary | |
---|---|
protected Connection |
connection
The database connection. |
protected Dictionary |
dictionary
|
protected Map<Integer,long[]> |
idToSynsetOffset
Mapping of database id's to synset offset id's. |
protected static int |
INTERNAL_ID
|
protected Map<Long,Integer> |
synsetOffsetToId
Mapping of synset offset id's to database id's. |
protected static String[] |
tables
|
protected static long |
TIME
|
Constructor Summary | |
---|---|
DictionaryToDatabase(Dictionary dictionary,
Connection conn)
Create a new DictionaryToDatabase with a database connection. |
Method Summary | |
---|---|
void |
createTables(String scriptFilePath)
Create the database tables. |
void |
insertData()
Inserts the data into the database. |
static void |
main(String[] args)
Run the program, requires 4 arguments. |
protected static int |
nextId()
|
protected void |
storeExceptions(Iterator<Exc> itr)
Store the exceptions file. |
protected void |
storeIndexWords(Iterator<IndexWord> itr)
Store all the index words. |
protected void |
storeIndexWordSynsets()
Store the index word synsets. |
protected void |
storeSynsets(Iterator<Synset> itr)
Store all of the synsets in the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static int INTERNAL_ID
protected static long TIME
protected static final String[] tables
protected Connection connection
protected Map<Integer,long[]> idToSynsetOffset
protected Map<Long,Integer> synsetOffsetToId
protected Dictionary dictionary
Constructor Detail |
---|
public DictionaryToDatabase(Dictionary dictionary, Connection conn)
dictionary
- the dictionaryconn
- the database connectionMethod Detail |
---|
public static void main(String[] args)
args
- argsprotected static int nextId()
public void createTables(String scriptFilePath) throws IOException, SQLException
scriptFilePath
- - the sql script filename
IOException
- IOException
SQLException
- SQLExceptionpublic void insertData() throws JWNLException, SQLException
JWNLException
- JWNLException
SQLException
- SQLExceptionprotected void storeIndexWords(Iterator<IndexWord> itr) throws SQLException
itr
- - the index word iterator
SQLException
- SQLExceptionprotected void storeSynsets(Iterator<Synset> itr) throws SQLException
itr
- itr
SQLException
- SQLExceptionprotected void storeIndexWordSynsets() throws SQLException
SQLException
- SQLExceptionprotected void storeExceptions(Iterator<Exc> itr) throws SQLException
itr
- iterator
SQLException
- SQLException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |