From ea46ddebb0f76a483cb121cf7c6f0fa3a340156a Mon Sep 17 00:00:00 2001 From: amontano Date: Wed, 11 Mar 2009 23:47:59 +0000 Subject: [PATCH] Added non-breaking space to wylie. --- source/org/thdl/tib/scanner/Manipulate.java | 2 +- .../thdl/tib/scanner/RemoteScannerFilter.java | 68 ++++++++++--------- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/source/org/thdl/tib/scanner/Manipulate.java b/source/org/thdl/tib/scanner/Manipulate.java index 1a88e32..fb83689 100644 --- a/source/org/thdl/tib/scanner/Manipulate.java +++ b/source/org/thdl/tib/scanner/Manipulate.java @@ -26,7 +26,7 @@ public class Manipulate { private static String endOfParagraphMarks = "/;|!:^@#$%=,"; private static String bracketMarks = "<>(){}[]"; - private static String endOfSyllableMarks = " _\t"; + private static String endOfSyllableMarks = " _\t\u00A0"; private static String allStopMarkers = endOfSyllableMarks + endOfParagraphMarks + bracketMarks; private static final int TIBETAN_UNICODE_RANGE[] = {3840, 4095}; private static String JSON_ESCAPABLES = "\"\\/"; diff --git a/source/org/thdl/tib/scanner/RemoteScannerFilter.java b/source/org/thdl/tib/scanner/RemoteScannerFilter.java index f07ff42..733d8ec 100644 --- a/source/org/thdl/tib/scanner/RemoteScannerFilter.java +++ b/source/org/thdl/tib/scanner/RemoteScannerFilter.java @@ -18,7 +18,6 @@ Contributor(s): ______________________________________. package org.thdl.tib.scanner; import java.io.BufferedReader; -import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ResourceBundle; @@ -147,49 +146,54 @@ public class RemoteScannerFilter extends GenericServlet break; case JSON: linea = req.getParameter("text"); - linea = Manipulate.NCR2UnicodeString(linea); - if (Manipulate.guessIfUnicode(linea)) linea = BasicTibetanTranscriptionConverter.unicodeToWylie(linea); - else if (Manipulate.guessIfAcip(linea)) linea = BasicTibetanTranscriptionConverter.acipToWylie(linea); - scanner.scanLine(linea); + if (linea!=null) + { + linea = Manipulate.NCR2UnicodeString(linea); + if (Manipulate.guessIfUnicode(linea)) linea = BasicTibetanTranscriptionConverter.unicodeToWylie(linea); + else if (Manipulate.guessIfAcip(linea)) linea = BasicTibetanTranscriptionConverter.acipToWylie(linea); + scanner.scanLine(linea); + } } scanner.finishUp(); words = scanner.getWordArray(); - - for (i=0; i