diff --git a/source/org/thdl/tib/scanner/LocalTibetanScanner.java b/source/org/thdl/tib/scanner/LocalTibetanScanner.java index 29f4fd0..42bce24 100644 --- a/source/org/thdl/tib/scanner/LocalTibetanScanner.java +++ b/source/org/thdl/tib/scanner/LocalTibetanScanner.java @@ -339,7 +339,7 @@ outAHere: */ fin = init+1; - while (true) + while (fin < linea.length()) { ch = linea.charAt(fin); if (endOfParagraphMarks.indexOf(ch)>=0) diff --git a/source/org/thdl/tib/scanner/OnLineScannerFilter.java b/source/org/thdl/tib/scanner/OnLineScannerFilter.java index a9e5f9b..458d037 100644 --- a/source/org/thdl/tib/scanner/OnLineScannerFilter.java +++ b/source/org/thdl/tib/scanner/OnLineScannerFilter.java @@ -58,15 +58,30 @@ public class OnLineScannerFilter extends HttpServlet { PrintWriter out = response.getWriter(); String parrafo = request.getParameter("parrafo"), checkboxName, script; DictionarySource ds=null; - boolean checkedDicts[], allUnchecked, wantsTibetan; + boolean checkedDicts[], allUnchecked, wantsTibetan, useTHDLBanner = (request.getParameter("thdlBanner")!=null); // int percent=100; - out.println(""); + if (useTHDLBanner) + { + out.println(" "); + } + else out.println(""); + out.println(""); - out.println(""); - out.println(""); - out.println(""); - out.println("The Online Tibetan to English Translation/Dictionary Tool"); + if (useTHDLBanner) + { + out.println(" Tibetan and Himalayan Digital Library - The Online Tibetan to English Translation/Dictionary Tool"); + out.println(" "); + out.println(" "); + out.println(" "); + } + else + out.println(" The Online Tibetan to English Translation/Dictionary Tool"); + + out.println(" "); + out.println(" "); + out.println(" "); + script = request.getParameter("script"); /* script==null || makes default tibetan @@ -90,6 +105,43 @@ public class OnLineScannerFilter extends HttpServlet { } out.println(""); out.println(""); + + + if (useTHDLBanner) + { + out.println("
"); + out.println(" \"THDL"); + out.println("

Tibetan and Himalayan Digital Library

"); + out.println("
"); + out.println(" "); + out.println(" "); + out.println(" "); + out.println(" "); + out.println(" "); + out.println("
Menu Loading...
"); + + out.println("
"); + out.println("
"); + + out.println("
"); + out.println("
"); + out.println("
"); + out.println("

"); + out.println(" "); + out.println(" "); + out.println(" "); + out.println("

"); + out.println("
"); + out.println("
"); + out.println("
"); + out.println(" Home > Reference > Translation Tool |"); + out.println(" Tibetan Script Input Version (Java needed) |"); + out.println(" Documentation"); + out.println("
"); + out.println("
"); + out.println("
"); + } + out.println("

The Online Tibetan to English Translation/Dictionary Tool

"); out.println("
"); out.println(""); @@ -180,6 +232,7 @@ public class OnLineScannerFilter extends HttpServlet { desglosar(parrafo, out, wantsTibetan); out.println(TibetanScanner.copyrightHTML); + if (useTHDLBanner) out.println(""); out.println(""); out.println(""); } diff --git a/source/org/thdl/tib/scanner/TibetanScanner.java b/source/org/thdl/tib/scanner/TibetanScanner.java index 095e8b6..553ed90 100644 --- a/source/org/thdl/tib/scanner/TibetanScanner.java +++ b/source/org/thdl/tib/scanner/TibetanScanner.java @@ -285,11 +285,11 @@ public abstract class TibetanScanner public Token[] getTokenArray() { - int i=0; - Token token[] = new Token[wordList.size()]; + int n=wordList.size(); + Token token[] = new Token[n]; SimplifiedListIterator li = wordList.listIterator(); while(li.hasNext()) - token[i++] = (Token)li.next(); + token[--n] = (Token)li.next(); return token; } diff --git a/source/org/thdl/tib/scanner/Word.java b/source/org/thdl/tib/scanner/Word.java index 3c72cb0..b8821d1 100644 --- a/source/org/thdl/tib/scanner/Word.java +++ b/source/org/thdl/tib/scanner/Word.java @@ -91,7 +91,17 @@ public class Word extends Token public String getBookmark(boolean tibetan) { String localWord; - if (tibetan) localWord = TibetanHTML.getHTML(super.token + " "); + if (tibetan) + { + try + { + localWord = TibetanHTML.getHTML(super.token + " "); + } + catch (Exception e) + { + localWord = "" + super.token + ""; + } + } else localWord = "" + super.token + ""; return "" + localWord + ""; } @@ -103,16 +113,27 @@ public class Word extends Token public String getLink(boolean tibetan) { - String localWord; + String localWord, result=null; // String result; if (wordSinDec==null) localWord = super.token; else localWord = wordSinDec; - if (tibetan) localWord = TibetanHTML.getHTML(localWord + " "); + if (tibetan) + { + try + { + result = TibetanHTML.getHTML(localWord + " "); + } + catch (Exception e) + { + result = localWord; + } + } + else result = localWord; /* result = "" + localWord; if (tibetan) result+= ""; else result+= " "; return result;*/ - return "" + localWord + " "; + return "" + result + " "; } /** Called in order to redisplay the text with links keeping