Fixed stability bug
This commit is contained in:
parent
57895d945f
commit
b1cc500abf
1 changed files with 61 additions and 44 deletions
|
@ -384,53 +384,70 @@ public class OnLineScannerFilter extends HttpServlet
|
||||||
pw.println("</p>");
|
pw.println("</p>");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void printAllDefs(PrintWriter pw, boolean tibetan)
|
public void printAllDefs(PrintWriter pw, boolean tibetan) {
|
||||||
{
|
int i, j, k=0;
|
||||||
int i, j;
|
|
||||||
Word words[];
|
Word words[];
|
||||||
SwingWord word=null;
|
SwingWord word = null;
|
||||||
Definitions defs;
|
Definitions defs;
|
||||||
String tag;
|
String tag;
|
||||||
DictionarySource ds;
|
DictionarySource ds;
|
||||||
|
ByteDictionarySource sourceb=null;
|
||||||
|
|
||||||
words = scanner.getWordArray(false);
|
words = scanner.getWordArray(false);
|
||||||
|
|
||||||
if (words == null) return;
|
if (words == null)
|
||||||
|
return;
|
||||||
|
|
||||||
pw.println("<table border=\"1\" width=\"100%\">");
|
pw.println("<table border=\"1\" width=\"100%\">");
|
||||||
|
|
||||||
for (j=0; j<words.length; j++)
|
for (j = 0; j < words.length; j++) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
word = new SwingWord(words[j]);
|
word = new SwingWord(words[j]);
|
||||||
defs = word.getDefs();
|
defs = word.getDefs();
|
||||||
ds = defs.getDictionarySource();
|
ds = defs.getDictionarySource();
|
||||||
pw.println(" <tr>");
|
pw.println(" <tr>");
|
||||||
if (ds!=null && !ds.isEmpty()) tag = ds.getTag(0);
|
if (ds == null) {
|
||||||
else tag = " ";
|
tag = " ";
|
||||||
if (tag==null) tag = " ";
|
}
|
||||||
|
else {
|
||||||
|
if (FileSyllableListTree.versionNumber==2) {
|
||||||
|
tag = ds.getTag(0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sourceb = (ByteDictionarySource) ds;
|
||||||
|
k=0;
|
||||||
|
while (sourceb.isEmpty(k)) k++;
|
||||||
|
tag = sourceb.getTag(k);
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pw.println(" <td width=\"20%\" rowspan=\""+ defs.def.length +"\" valign=\"top\">"+ word.getBookmark(tibetan) +"</td>");
|
pw.println(" <td width=\"20%\" rowspan=\"" + defs.def.length
|
||||||
pw.println(" <td width=\"12%\">"+ tag +"</td>");
|
+ "\" valign=\"top\">" + word.getBookmark(tibetan)
|
||||||
|
+ "</td>");
|
||||||
|
pw.println(" <td width=\"12%\">" + tag + "</td>");
|
||||||
pw.println(" <td width=\"68%\">" + defs.def[0] + "</td>");
|
pw.println(" <td width=\"68%\">" + defs.def[0] + "</td>");
|
||||||
|
|
||||||
pw.println(" </tr>");
|
pw.println(" </tr>");
|
||||||
for (i=1; i<defs.def.length; i++)
|
for (i = 1; i < defs.def.length; i++) {
|
||||||
{
|
|
||||||
pw.println(" <tr>");
|
pw.println(" <tr>");
|
||||||
if (ds!=null && !ds.isEmpty()) tag = ds.getTag(i);
|
|
||||||
else tag = " ";
|
if (FileSyllableListTree.versionNumber==2) {
|
||||||
if (tag==null) tag = " ";
|
tag = ds.getTag(i);
|
||||||
pw.println(" <td width=\"12%\">"+ tag +"</td>");
|
}
|
||||||
|
else {
|
||||||
|
while (sourceb.isEmpty(k)) k++;
|
||||||
|
tag = sourceb.getTag(k);
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
|
||||||
|
pw.println(" <td width=\"12%\">" + tag + "</td>");
|
||||||
pw.println(" <td width=\"68%\">" + defs.def[i] + "</td>");
|
pw.println(" <td width=\"68%\">" + defs.def[i] + "</td>");
|
||||||
//else pw.println(" <td width=\"80%\" colspan=\"2\">" + defs.def[i] + "</td>");
|
//else pw.println(" <td width=\"80%\" colspan=\"2\">" + defs.def[i] + "</td>");
|
||||||
pw.println(" </tr>");
|
pw.println(" </tr>");
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
sl.writeLog("Crash\tOnLineScannerFilter\t" + word.getWylie());
|
sl.writeLog("Crash\tOnLineScannerFilter\t" + word.getWylie());
|
||||||
sl.writeException(e);
|
sl.writeException(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue