From c12088ce5dd54a9eaa56cd2b38c0025638d4bf5c Mon Sep 17 00:00:00 2001 From: amontano Date: Wed, 27 Nov 2002 23:30:44 +0000 Subject: [PATCH] fixed the importing of dictionaries using '-' as a separator, without confusing such character with reverse vowel in the tibetanized sanskrit. --- .../thdl/tib/scanner/BinaryFileGenerator.java | 493 ++++++++++-------- 1 file changed, 264 insertions(+), 229 deletions(-) diff --git a/source/org/thdl/tib/scanner/BinaryFileGenerator.java b/source/org/thdl/tib/scanner/BinaryFileGenerator.java index 8aa1e6a..33d3ac4 100644 --- a/source/org/thdl/tib/scanner/BinaryFileGenerator.java +++ b/source/org/thdl/tib/scanner/BinaryFileGenerator.java @@ -36,6 +36,10 @@ public class BinaryFileGenerator extends LinkedList private long posHijos; private String sil, def[]; private static String delimiter; + private static int delimiterType; + private final static int delimiterGeneric=0; + private final static int delimiterAcip=1; + private final static int delimiterDash=2; /** Number of dictionary. If 0, partial word (no definition). */ @@ -47,7 +51,8 @@ public class BinaryFileGenerator extends LinkedList { wordRaf = null; defRaf = null; - delimiter = " - "; + delimiter = null; + delimiterType=delimiterDash; } public BinaryFileGenerator() @@ -110,273 +115,288 @@ public class BinaryFileGenerator extends LinkedList boolean markerNotFound; // used for acip dict - if (delimiter==null) + switch(delimiterType) { - outAHere: - while (true) - { - entrada=br.readLine(); - if (entrada==null) break; - currentLine++; - - entrada = entrada.trim(); - len = entrada.length(); - if (len<=0) continue; - - // get page number - if (entrada.charAt(0)=='@') - { - marker = 1; - while(marker0) - currentPage=Integer.parseInt(temp); - if (marker0) + currentPage=Integer.parseInt(temp); + if (marker=0 && marker2) { printSintax(); @@ -576,14 +602,23 @@ public class BinaryFileGenerator extends LinkedList if (args[i].charAt(0)=='-') { if (args[i].equals("-tab")) - delimiter="\t"; + { + delimiterType=delimiterGeneric; + delimiter="\t"; + } else if (args[i].equals("-acip")) - delimiter=null; + delimiterType=delimiterAcip; else + { + delimiterType=delimiterGeneric; delimiter=args[i].substring(1); + } i++; } - else delimiter=" -"; + else + { + delimiterType=delimiterDash; + } sl.addFile(args[i] + ".txt", n); n++; i++; }