diff --git a/src/java/org/thdl/lex/test/DictionaryImporter.java b/src/java/org/thdl/lex/test/DictionaryImporter.java deleted file mode 100644 index f3357b9..0000000 --- a/src/java/org/thdl/lex/test/DictionaryImporter.java +++ /dev/null @@ -1,263 +0,0 @@ -package org.thdl.lex; -import java.net.*; -import java.io.*; -import java.util.*; -import org.thdl.lex.*; -import org.thdl.lex.component.*; -import org.thdl.tib.scanner.Manipulate; - -public class DictionaryImporter -{ - private PrintWriter out; - private BufferedReader in; - private String delim; - private int delimiterType; - - public final static int delimiterGeneric=0; - public final static int delimiterAcip=1; - public final static int delimiterDash=2; - -//helpers - public void doImport() throws Exception - { - String entrada, s1, s2, alternateWords[]; - int marker, marker2, len, currentLine=1; - long start = System.currentTimeMillis(); - - while ((entrada = in.readLine())!=null) - { - entrada = entrada.trim(); - if (!entrada.equals("")) - { - switch(delimiterType) - { - /* this is needed to make sure that the dash used in reverse vowels with extended - wylie is not confused with the dash that separates definiendum and definition. */ - case delimiterDash: - marker=entrada.indexOf('-'); - len = entrada.length(); - while (marker>=0 && marker0) - { - alternateWords = s1.split(";"); - for (marker2=0; marker2= 0) - in = new BufferedReader(new InputStreamReader(new BufferedInputStream((new URL(args[currentArg])).openStream()))); - else - in = new BufferedReader(new InputStreamReader(new FileInputStream(args[currentArg]))); - } - - new DictionaryImporter(in, out).doImport(); - } - catch ( Exception e ) - { - e.printStackTrace(); - } - } -} diff --git a/src/java/org/thdl/lex/util/DictionaryImporter.java b/src/java/org/thdl/lex/util/DictionaryImporter.java new file mode 100644 index 0000000..192ebbc --- /dev/null +++ b/src/java/org/thdl/lex/util/DictionaryImporter.java @@ -0,0 +1,334 @@ +package org.thdl.lex.util; + +import java.net.*; +import java.io.*; +import java.util.*; +import org.thdl.lex.*; +import org.thdl.lex.component.*; +import org.thdl.tib.scanner.Manipulate; + +public class DictionaryImporter +{ + private static PrintWriter out; + private static BufferedReader in; + private static String delimiter; + private static int delimiterType; + private static Integer creator; + private static String note; + private static Integer proj; + private static String publicCons; + private static Integer label; + + public final static int delimiterGeneric=0; + public final static int delimiterAcip=1; + public final static int delimiterDash=2; + +//helpers + public void doImport() throws Exception + { + String entrada, s1, s2, alternateWords[]; + int marker, marker2, len, currentLine=1; + long start = System.currentTimeMillis(); + + while ((entrada = in.readLine())!=null) + { + entrada = entrada.trim(); + if (!entrada.equals("")) + { + switch(delimiterType) + { + /* this is needed to make sure that the dash used in reverse vowels with extended + wylie is not confused with the dash that separates definiendum and definition. */ + case delimiterDash: + marker=entrada.indexOf('-'); + len = entrada.length(); + while (marker>=0 && marker0) + { + alternateWords = s1.split(";"); + for (marker2=0; marker2= 0) + is = new BufferedInputStream((new URL(args[currentArg])).openStream()); + else + is = new FileInputStream(args[currentArg]); + + if (format==null) + in = new BufferedReader(new InputStreamReader(is)); + else + in = new BufferedReader(new InputStreamReader(is, format)); + } + + new DictionaryImporter().doImport(); + } +}