Added non-breaking space to wylie.
This commit is contained in:
parent
6c19b1e0b9
commit
ea46ddebb0
2 changed files with 37 additions and 33 deletions
|
@ -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 = "\"\\/";
|
||||||
|
|
|
@ -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,49 +146,54 @@ public class RemoteScannerFilter extends GenericServlet
|
||||||
break;
|
break;
|
||||||
case JSON:
|
case JSON:
|
||||||
linea = req.getParameter("text");
|
linea = req.getParameter("text");
|
||||||
linea = Manipulate.NCR2UnicodeString(linea);
|
if (linea!=null)
|
||||||
if (Manipulate.guessIfUnicode(linea)) linea = BasicTibetanTranscriptionConverter.unicodeToWylie(linea);
|
{
|
||||||
else if (Manipulate.guessIfAcip(linea)) linea = BasicTibetanTranscriptionConverter.acipToWylie(linea);
|
linea = Manipulate.NCR2UnicodeString(linea);
|
||||||
scanner.scanLine(linea);
|
if (Manipulate.guessIfUnicode(linea)) linea = BasicTibetanTranscriptionConverter.unicodeToWylie(linea);
|
||||||
|
else if (Manipulate.guessIfAcip(linea)) linea = BasicTibetanTranscriptionConverter.acipToWylie(linea);
|
||||||
|
scanner.scanLine(linea);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
scanner.finishUp();
|
scanner.finishUp();
|
||||||
words = scanner.getWordArray();
|
words = scanner.getWordArray();
|
||||||
|
if (words!=null)
|
||||||
for (i=0; i<words.length; i++)
|
|
||||||
{
|
{
|
||||||
linea = words[i].getDef();
|
for (i=0; i<words.length; i++)
|
||||||
if (linea == null) continue;
|
|
||||||
switch (format)
|
|
||||||
{
|
{
|
||||||
case INTERNAL:
|
linea = words[i].getDef();
|
||||||
out.println(words[i].getWylie());
|
if (linea == null) continue;
|
||||||
out.println(linea);
|
switch (format)
|
||||||
out.println();
|
|
||||||
break;
|
|
||||||
case JSON:
|
|
||||||
out.println("\"" + BasicTibetanTranscriptionConverter.wylieToHTMLUnicode(words[i].token) + "\": [");
|
|
||||||
defs = words[i].getDefs();
|
|
||||||
dict_source = (ByteDictionarySource)defs.getDictionarySource();
|
|
||||||
k=0;
|
|
||||||
for (j=0; j<defs.def.length; j++)
|
|
||||||
{
|
{
|
||||||
while (dict_source.isEmpty(k)) k++;
|
case INTERNAL:
|
||||||
tag = dict_source.getTag(k);
|
out.println(words[i].getWylie());
|
||||||
k++;
|
out.println(linea);
|
||||||
out.println("\"" + tag + "\",");
|
out.println();
|
||||||
out.print("\"" + Manipulate.toJSON(defs.def[j]) + "\"");
|
break;
|
||||||
if (j==defs.def.length-1) out.println();
|
case JSON:
|
||||||
else out.println(",");
|
out.println("\"" + BasicTibetanTranscriptionConverter.wylieToHTMLUnicode(words[i].token) + "\": [");
|
||||||
|
defs = words[i].getDefs();
|
||||||
|
dict_source = (ByteDictionarySource)defs.getDictionarySource();
|
||||||
|
k=0;
|
||||||
|
for (j=0; j<defs.def.length; j++)
|
||||||
|
{
|
||||||
|
while (dict_source.isEmpty(k)) k++;
|
||||||
|
tag = dict_source.getTag(k);
|
||||||
|
k++;
|
||||||
|
out.println("\"" + tag + "\",");
|
||||||
|
out.print("\"" + Manipulate.toJSON(defs.def[j]) + "\"");
|
||||||
|
if (j==defs.def.length-1) out.println();
|
||||||
|
else out.println(",");
|
||||||
|
}
|
||||||
|
out.print("]");
|
||||||
|
if (i<words.length-1) out.println(",");
|
||||||
}
|
}
|
||||||
out.print("]");
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue