Added debug info to the servlet version.
This commit is contained in:
parent
9507ff3694
commit
107fcce565
8 changed files with 210 additions and 200 deletions
|
@ -229,6 +229,7 @@ public class FileSyllableListTree implements SyllableListTree
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
System.out.println(e);
|
System.out.println(e);
|
||||||
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -252,6 +253,7 @@ public class FileSyllableListTree implements SyllableListTree
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
System.out.println(e);
|
System.out.println(e);
|
||||||
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -379,7 +379,6 @@ public class OnLineScannerFilter extends HttpServlet
|
||||||
pw.print(pm + " ");
|
pw.print(pm + " ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pw.println("</p>");
|
pw.println("</p>");
|
||||||
|
@ -389,7 +388,7 @@ public class OnLineScannerFilter extends HttpServlet
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
Word words[];
|
Word words[];
|
||||||
SwingWord word;
|
SwingWord word=null;
|
||||||
Definitions defs;
|
Definitions defs;
|
||||||
String tag;
|
String tag;
|
||||||
DictionarySource ds;
|
DictionarySource ds;
|
||||||
|
@ -402,10 +401,13 @@ public class OnLineScannerFilter extends HttpServlet
|
||||||
|
|
||||||
for (j=0; j<words.length; j++)
|
for (j=0; j<words.length; j++)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
word = new SwingWord(words[j]);
|
word = new SwingWord(words[j]);
|
||||||
defs = word.getDefs();
|
defs = word.getDefs();
|
||||||
ds = defs.getDictionarySource();
|
ds = defs.getDictionarySource();
|
||||||
if (ds==null) continue;
|
if (ds==null || ds.isEmpty()) continue;
|
||||||
pw.println(" <tr>");
|
pw.println(" <tr>");
|
||||||
tag = ds.getTag(0);
|
tag = ds.getTag(0);
|
||||||
// else tag = null;
|
// else tag = null;
|
||||||
|
@ -435,6 +437,13 @@ public class OnLineScannerFilter extends HttpServlet
|
||||||
pw.println(" </tr>");
|
pw.println(" </tr>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
sl.writeLog("Crash\tOnLineScannerFilter\t" + word.getWylie());
|
||||||
|
sl.writeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
pw.println("</table>");
|
pw.println("</table>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,7 @@ public class RemoteScannerFilter extends GenericServlet
|
||||||
res.setContentType ("text/plain");
|
res.setContentType ("text/plain");
|
||||||
sl.setUserIP(req.getRemoteAddr());
|
sl.setUserIP(req.getRemoteAddr());
|
||||||
|
|
||||||
Token token[] = null;
|
Word word = null, words[] = null;
|
||||||
Word word = null;
|
|
||||||
PrintWriter out;
|
PrintWriter out;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -117,27 +116,28 @@ public class RemoteScannerFilter extends GenericServlet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* FIXME: sometimes getDef returns raises a NullPointerException.
|
/* FIXME: sometimes getDef raises a NullPointerException.
|
||||||
In the meantime, I'll just keep it from crashing
|
In the meantime, I'll just keep it from crashing
|
||||||
*/
|
*/
|
||||||
sl.writeLog("Translation\tRemoteScannerFilter");
|
sl.writeLog("Translation\tRemoteScannerFilter");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
scanner.clearTokens();
|
||||||
while((linea = br.readLine())!= null)
|
while((linea = br.readLine())!= null)
|
||||||
scanner.scanLine(linea);
|
scanner.scanLine(linea);
|
||||||
|
|
||||||
br.close();
|
br.close();
|
||||||
|
|
||||||
scanner.finishUp();
|
scanner.finishUp();
|
||||||
token = scanner.getTokenArray();
|
words = scanner.getWordArray();
|
||||||
|
|
||||||
for (i=0; i<token.length; i++)
|
for (i=0; i<words.length; i++)
|
||||||
{
|
{
|
||||||
if (!(token[i] instanceof Word)) continue;
|
linea = words[i].getDef();
|
||||||
word = (Word) token[i];
|
if (linea == null) continue;
|
||||||
out.println(word.getWylie());
|
out.println(words[i].getWylie());
|
||||||
out.println(word.getDef());
|
out.println(linea);
|
||||||
out.println();
|
out.println();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,7 @@ public class ScannerLogger
|
||||||
{
|
{
|
||||||
PrintStream pw = getPrintStream();
|
PrintStream pw = getPrintStream();
|
||||||
if (lastIP!=null) pw.print(lastIP);
|
if (lastIP!=null) pw.print(lastIP);
|
||||||
|
else pw.print("-");
|
||||||
pw.println("\t" + getCurrentTime() + "\t" + s);
|
pw.println("\t" + getCurrentTime() + "\t" + s);
|
||||||
pw.flush();
|
pw.flush();
|
||||||
pw.close();
|
pw.close();
|
||||||
|
|
|
@ -332,7 +332,6 @@ public abstract class TibetanScanner
|
||||||
if (includeRepeated)
|
if (includeRepeated)
|
||||||
{
|
{
|
||||||
n = ll.size();
|
n = ll.size();
|
||||||
|
|
||||||
if (n==0) return null;
|
if (n==0) return null;
|
||||||
|
|
||||||
array = new Word[n];
|
array = new Word[n];
|
||||||
|
@ -352,7 +351,6 @@ public abstract class TibetanScanner
|
||||||
while(li.hasNext())
|
while(li.hasNext())
|
||||||
{
|
{
|
||||||
word = (Word) li.next();
|
word = (Word) li.next();
|
||||||
|
|
||||||
if (!ll2.contains(word)) ll2.addLast(word);
|
if (!ll2.contains(word)) ll2.addLast(word);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue