minor changes

This commit is contained in:
amontano 2004-07-01 03:01:09 +00:00
parent 45ed01d12a
commit 6cc4bfac6b

View file

@ -127,7 +127,7 @@ public class DictionaryImporter
// if there is, append the definition if it is different. If not add it. // if there is, append the definition if it is different. If not add it.
if (set.first()) if (set.first())
{ {
currentDef = set.getString(1); currentDef = set.getString(1).trim();
currentDef = Manipulate.replace(currentDef, "\\", "@@@@"); currentDef = Manipulate.replace(currentDef, "\\", "@@@@");
currentDef = Manipulate.replace(currentDef, "@@@@", "\\\\"); currentDef = Manipulate.replace(currentDef, "@@@@", "\\\\");
@ -137,7 +137,7 @@ public class DictionaryImporter
if (currentDef.indexOf(definition)<0) if (currentDef.indexOf(definition)<0)
{ {
definition = currentDef + ". " + definition; if (!currentDef.equals("")) definition = currentDef + ". " + definition;
metaIDTrans = set.getInt(2); metaIDTrans = set.getInt(2);
sqlStatement.execute("UPDATE transitionaldata SET transitionaldatatext = \"" + definition + "\" WHERE metaid = " + metaIDTrans); sqlStatement.execute("UPDATE transitionaldata SET transitionaldatatext = \"" + definition + "\" WHERE metaid = " + metaIDTrans);
} }
@ -159,6 +159,7 @@ public class DictionaryImporter
private void addRecord(String term, String definition) throws Exception private void addRecord(String term, String definition) throws Exception
{ {
term = Manipulate.replace(term, " ", " ");
if (out!=null) out.println(term + " - " + definition); if (out!=null) out.println(term + " - " + definition);
else if (sqlStatement!=null) addRecordManually(term, definition); else if (sqlStatement!=null) addRecordManually(term, definition);
else addRecordViaHibernate(term, definition); else addRecordViaHibernate(term, definition);
@ -240,8 +241,9 @@ public class DictionaryImporter
if (found) if (found)
{ {
existingDef = trans.getTransitionalDataText(); existingDef = trans.getTransitionalDataText().trim();
if (existingDef.indexOf(definition)<0) if (existingDef.equals("")) found = false;
else if (existingDef.indexOf(definition)<0)
{ {
definition = existingDef + ". " + definition; definition = existingDef + ". " + definition;
found = false; found = false;