Added non-breaking space to wylie.

This commit is contained in:
amontano 2009-03-11 23:47:59 +00:00
parent 6c19b1e0b9
commit ea46ddebb0
2 changed files with 37 additions and 33 deletions

View file

@ -26,7 +26,7 @@ public class Manipulate
{ {
private static String endOfParagraphMarks = "/;|!:^@#$%=,"; private static String endOfParagraphMarks = "/;|!:^@#$%=,";
private static String bracketMarks = "<>(){}[]"; private static String bracketMarks = "<>(){}[]";
private static String endOfSyllableMarks = " _\t"; private static String endOfSyllableMarks = " _\t\u00A0";
private static String allStopMarkers = endOfSyllableMarks + endOfParagraphMarks + bracketMarks; private static String allStopMarkers = endOfSyllableMarks + endOfParagraphMarks + bracketMarks;
private static final int TIBETAN_UNICODE_RANGE[] = {3840, 4095}; private static final int TIBETAN_UNICODE_RANGE[] = {3840, 4095};
private static String JSON_ESCAPABLES = "\"\\/"; private static String JSON_ESCAPABLES = "\"\\/";

View file

@ -18,7 +18,6 @@ Contributor(s): ______________________________________.
package org.thdl.tib.scanner; package org.thdl.tib.scanner;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.ResourceBundle; import java.util.ResourceBundle;
@ -147,14 +146,18 @@ public class RemoteScannerFilter extends GenericServlet
break; break;
case JSON: case JSON:
linea = req.getParameter("text"); linea = req.getParameter("text");
if (linea!=null)
{
linea = Manipulate.NCR2UnicodeString(linea); linea = Manipulate.NCR2UnicodeString(linea);
if (Manipulate.guessIfUnicode(linea)) linea = BasicTibetanTranscriptionConverter.unicodeToWylie(linea); if (Manipulate.guessIfUnicode(linea)) linea = BasicTibetanTranscriptionConverter.unicodeToWylie(linea);
else if (Manipulate.guessIfAcip(linea)) linea = BasicTibetanTranscriptionConverter.acipToWylie(linea); else if (Manipulate.guessIfAcip(linea)) linea = BasicTibetanTranscriptionConverter.acipToWylie(linea);
scanner.scanLine(linea); scanner.scanLine(linea);
} }
}
scanner.finishUp(); scanner.finishUp();
words = scanner.getWordArray(); words = scanner.getWordArray();
if (words!=null)
{
for (i=0; i<words.length; i++) for (i=0; i<words.length; i++)
{ {
linea = words[i].getDef(); linea = words[i].getDef();
@ -185,11 +188,12 @@ public class RemoteScannerFilter extends GenericServlet
if (i<words.length-1) out.println(","); if (i<words.length-1) out.println(",");
} }
} }
}
if (format==JSON) out.println("}});"); if (format==JSON) out.println("}});");
} }
catch (Exception e) catch (Exception e)
{ {
sl.writeLog("1\t2\t" + word.getWylie()); if (word!=null) sl.writeLog("1\t2\t" + word.getWylie());
sl.writeException(e); sl.writeException(e);
} }