From 07c045341b29993624b7a6f24cf85f534971fc0b Mon Sep 17 00:00:00 2001 From: amontano Date: Mon, 5 Jul 2004 03:51:11 +0000 Subject: [PATCH] included a guessIfAcip method. Used by the translation tool to paste wylie or ACIP accordingly. --- source/org/thdl/tib/scanner/Manipulate.java | 35 +++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/source/org/thdl/tib/scanner/Manipulate.java b/source/org/thdl/tib/scanner/Manipulate.java index 32a274a..1771212 100644 --- a/source/org/thdl/tib/scanner/Manipulate.java +++ b/source/org/thdl/tib/scanner/Manipulate.java @@ -28,7 +28,7 @@ import org.thdl.util.*; public class Manipulate { - public static String[] parseFields (String s, char delimiter) + /* public static String[] parseFields (String s, char delimiter) { int pos; String field; @@ -43,7 +43,7 @@ public class Manipulate ll.addLast(s.trim()); return ll.toStringArray(); - } + }*/ public static String replace(String linea, String origSub, String newSub) { @@ -124,6 +124,27 @@ public class Manipulate return nuevaPalabra; } + /** If more than half of the first letters among the first are 10 characters + are uppercase assume its acip */ + public static boolean guessIfAcip(String line) + { + char ch; + int letters=0, upperCase=0, i, n; + n = line.length(); + if (n>10) n = 10; + for (i=0; i2) + { + if ((s.charAt(0)=='\"') && (s.charAt(length-1)=='\"')) + return s.substring(1,length-1); + } + return s; + } /** Syntax: java Manipulate [word-file] < source-dic-entries > dest-dic-entries