diff software/mpdl-services/mpiwg-mpdl-lt/src/de/mpg/mpiwg/berlin/mpdl/lt/dict/app/Lexica.java @ 23:e845310098ba

diverse Korrekturen
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Tue, 27 Nov 2012 12:35:19 +0100
parents 4a3641ae14d2
children
line wrap: on
line diff
--- a/software/mpdl-services/mpiwg-mpdl-lt/src/de/mpg/mpiwg/berlin/mpdl/lt/dict/app/Lexica.java	Wed Dec 14 13:57:09 2011 +0100
+++ b/software/mpdl-services/mpiwg-mpdl-lt/src/de/mpg/mpiwg/berlin/mpdl/lt/dict/app/Lexica.java	Tue Nov 27 12:35:19 2012 +0100
@@ -1,6 +1,7 @@
 package de.mpg.mpiwg.berlin.mpdl.lt.dict.app;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Set;
@@ -21,6 +22,7 @@
 public class Lexica {
   private static Lexica instance;
   private static HashMap<String, Lexicon> localLexica = new HashMap<String, Lexicon>();
+  private static HashMap<String, String[]> localLangLexiconNames = new HashMap<String, String[]>();
   private static HashMap<String, Lexicon> remoteLexica = new HashMap<String, Lexicon>();
   
   public static Lexica getInstance() {
@@ -33,27 +35,25 @@
 
   private void init() {
     Lexicon autenrieth = new Lexicon("autenrieth", "el");
-    autenrieth.setDescription("Autenrieth, a Homeric lexicon");
+    autenrieth.setDescription("Autenrieth: A Homeric lexicon");
     autenrieth.setQueryUrl("http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.04.0073:entry=");
     Lexicon baretti = new Lexicon("baretti", "it");
-    baretti.setDescription("Baretti, a dictionary of the English and Italian languages");
+    baretti.setDescription("Baretti: A dictionary of the English and Italian languages");
     Lexicon bonitz = new Lexicon("bonitz", "el");
-    bonitz.setDescription("Bonitz, index Aristotelicus");
+    bonitz.setDescription("Bonitz: Index Aristotelicus");
     Lexicon cooper = new Lexicon("cooper", "la");
-    cooper.setDescription("Cooper, Thesaurus Linguae Romanae et Brittanicae");
+    cooper.setDescription("Cooper: Thesaurus Linguae Romanae et Brittanicae");
     Lexicon florio = new Lexicon("florio", "it");
-    florio.setDescription("Florio, a worlde of wordes, or most copious, dictionarie in Italian and English");
+    florio.setDescription("Florio: a worlde of wordes, or most copious, dictionarie in Italian and English");
     Lexicon ls = new Lexicon("ls", "la");
-    ls.setDescription("Lewis and Short, Latin dictionary");
+    ls.setDescription("Lewis and Short: Latin dictionary");
     ls.setQueryUrl("http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.04.0059:entry=");
     Lexicon lsj = new Lexicon("lsj", "el");
-    lsj.setDescription("Liddell-Scott-Jones, a Greek-English lexicon");
+    lsj.setDescription("Liddell-Scott-Jones: A Greek-English lexicon");
     lsj.setQueryUrl("http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.04.0057:entry=");
     Lexicon salmone = new Lexicon("salmone", "ar");
-    salmone.setDescription("Salmone, an advanced learner's Arabic-English dictionary");
+    salmone.setDescription("Salmone: An advanced learner's Arabic-English dictionary");
     salmone.setQueryUrl("http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:2002.02.0005:entry=");
-    Lexicon salmoneUnicode = new Lexicon("salmoneUnicode", "ar");
-    salmoneUnicode.setDescription("Salmone, an advanced learner's Arabic-English dictionary");
     Lexicon webster = new Lexicon("webster", "en");
     webster.setDescription("Webster's revised unabridged dictionary (1913)");
     localLexica.put("autenrieth", autenrieth);
@@ -65,14 +65,49 @@
     localLexica.put("lsj", lsj);
     localLexica.put("salmone", salmone);
     localLexica.put("webster", webster);
+    localLangLexiconNames = new HashMap<String, String[]>();
+    String[] arLangLexNames = {"salmone"};
+    localLangLexiconNames.put("ar", arLangLexNames);
+    String[] elLangLexNames = {"autenrieth", "bonitz", "lsj"};
+    localLangLexiconNames.put("el", elLangLexNames);
+    String[] enLangLexNames = {"webster"};
+    localLangLexiconNames.put("en", enLangLexNames);
+    String[] itLangLexNames = {"baretti", "florio"};
+    localLangLexiconNames.put("it", itLangLexNames);
+    String[] laLangLexNames = {"cooper", "ls"};
+    localLangLexiconNames.put("la", laLangLexNames);
     Lexicon dwds = new Lexicon("dwds", "de");
-    dwds.setDescription("Deutsches Wšrterbuch der deutschen Sprache");
+    dwds.setDescription("DWDS: Deutsches Wšrterbuch der deutschen Sprache");
     dwds.setQueryUrl("http://www.dwds.de/search/?qu=");
     dwds.setType("remote");
+    Lexicon leoDE = new Lexicon("leoDE", "de");
+    leoDE.setDescription("LEO: German - English Dictionary");
+    leoDE.setQueryUrl("http://dict.leo.org/ende?lang=en&search="); 
+    leoDE.setType("remote");
+    Lexicon dictLeipzigDE = new Lexicon("dictLeipzigDE", "de");
+    dictLeipzigDE.setDescription("UniversitŠt Leipzig: German - English Dictionary");
+    dictLeipzigDE.setQueryUrl("http://dict.uni-leipzig.de/index.php?wort=");
+    dictLeipzigDE.setType("remote");
+    Lexicon lingueeDE = new Lexicon("lingueeDE", "de");
+    lingueeDE.setDescription("Linguee: German - English Dictionary");
+    lingueeDE.setQueryUrl("http://www.linguee.de/deutsch-englisch/search?query=");
+    lingueeDE.setType("remote");
     Lexicon slater = new Lexicon("slater", "el");
-    slater.setDescription("William J. Slater, Lexicon to Pindar");
+    slater.setDescription("William J. Slater: Lexicon to Pindar");
     slater.setQueryUrl("http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.04.0072:entry=");
     slater.setType("remote");
+    Lexicon leoEN = new Lexicon("leoEN", "en");
+    leoEN.setDescription("LEO: German - English Dictionary");
+    leoEN.setQueryUrl("http://dict.leo.org/ende?lang=en&search=");
+    leoEN.setType("remote");
+    Lexicon lingueeEN = new Lexicon("lingueeEN", "en");
+    lingueeEN.setDescription("Linguee: German - English Dictionary");
+    lingueeEN.setQueryUrl("http://www.linguee.de/deutsch-englisch/search?query=");
+    lingueeEN.setType("remote");
+    Lexicon leoFR = new Lexicon("leoFR", "fr");
+    leoFR.setDescription("LEO: German - French Dictionary");
+    leoFR.setQueryUrl("http://dict.leo.org/frde?lang=en&search=");
+    leoFR.setType("remote");
     Lexicon artflFr = new Lexicon("artfl-fr", "fr");
     artflFr.setDescription("The ARTFL project: Dictionnaires d'autrefois: French dictionaries of the 17th, 18th, 19th and 20th centuries");
     artflFr.setQueryUrl("http://machaut.uchicago.edu/?resource=frengdict&amp;action=search&amp;french=");
@@ -81,37 +116,53 @@
     artflFrEn.setDescription("The ARTFL project: French - English dictionary");
     artflFrEn.setQueryUrl("http://artflx.uchicago.edu/cgi-bin/dicos/pubdico1look.pl?strippedhw=");
     artflFrEn.setType("remote");
+    Lexicon leoIT = new Lexicon("leoIT", "it");
+    leoIT.setDescription("LEO: German - Italian Dictionary");
+    leoIT.setQueryUrl("http://dict.leo.org/itde?lang=en&search=");
+    leoIT.setType("remote");
     Lexicon lewis = new Lexicon("lewis", "la");
-    lewis.setDescription("Charlton T. Lewis, an Elementary Latin Dictionary");
+    lewis.setDescription("Charlton T. Lewis: An Elementary Latin Dictionary");
     lewis.setQueryUrl("http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.04.0060:entry=");
     lewis.setType("remote");
     Lexicon wikiwoordenboek = new Lexicon("wikiwoordenboek", "nl");
     wikiwoordenboek.setDescription("Wiktionary: WikiWoordenboek");
     wikiwoordenboek.setQueryUrl("http://nl.wiktionary.org/wiki/");
     wikiwoordenboek.setType("remote");
+    Lexicon leoCH = new Lexicon("leoCH", "ch");
+    leoCH.setDescription("LEO: German - Chinese Dictionary");
+    leoCH.setQueryUrl("http://dict.leo.org/chde?lang=en&search=");
+    leoCH.setType("remote");
     Lexicon ctp = new Lexicon("ctp", "zh");
-    ctp.setDescription("Chinese Text Project");
+    ctp.setDescription("Chinese Text Project: Chinese - English Dictionary");
     ctp.setQueryUrl("http://ctext.org/dictionary.pl?if=en&amp;char=");
     ctp.setType("remote");
     Lexicon linyutan = new Lexicon("linyutan", "zh");
-    linyutan.setDescription("Lin Yutang");
+    linyutan.setDescription("Lin Yutang: Chinese - English Dictionary");
     linyutan.setQueryUrl("http://humanum.arts.cuhk.edu.hk/cgi-bin/agrep-lindict?query=");
     linyutan.setType("remote");
     Lexicon chineseUnicode = new Lexicon("chinese-unicode", "zh");
-    chineseUnicode.setDescription("Unicode");
+    chineseUnicode.setDescription("Unicode.org: Chinese - English");
     chineseUnicode.setQueryUrl("http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=");
     chineseUnicode.setType("remote");
     Lexicon chineseWiktionary = new Lexicon("chinese-wiktionary", "zh");
-    chineseWiktionary.setDescription("Wiktionary");
+    chineseWiktionary.setDescription("Wiktionary: Chinese - English");
     chineseWiktionary.setQueryUrl("http://en.wiktionary.org/wiki/");
     chineseWiktionary.setType("remote");
     remoteLexica.put("dwds", dwds);
+    remoteLexica.put("leoDE", leoDE);
+    remoteLexica.put("dictLeipzigDE", dictLeipzigDE);
+    remoteLexica.put("lingueeDE", lingueeDE);
     remoteLexica.put("slater", slater);
+    remoteLexica.put("leoEN", leoEN);
+    remoteLexica.put("lingueeEN", lingueeEN);
+    remoteLexica.put("leoFR", leoFR);
     remoteLexica.put("artfl-fr", artflFr);
     remoteLexica.put("artfl-fr-en", artflFrEn);
+    remoteLexica.put("leoIT", leoIT);
     remoteLexica.put("lewis", lewis);
     remoteLexica.put("wikiwoordenboek", wikiwoordenboek);
     remoteLexica.put("ctp", ctp);
+    remoteLexica.put("leoCH", leoCH);
     remoteLexica.put("linyutan", linyutan);
     remoteLexica.put("chinese-unicode", chineseUnicode);
     remoteLexica.put("chinese-wiktionary", chineseWiktionary);
@@ -142,6 +193,12 @@
     return retLexicons;
   }
 
+  public String[] getLocalLexiconNames(String lang) {
+    String language = Language.getInstance().getLanguageId(lang);
+    String[] retLexiconNames = localLangLexiconNames.get(language);
+    return retLexiconNames;
+  }
+
   public ArrayList<Lexicon> getRemoteLexicons(String lang) {
     String language = Language.getInstance().getLanguageId(lang);
     ArrayList<Lexicon> retLexicons = null;
@@ -157,6 +214,8 @@
         retLexicons.add(lexicon);
       }
     }
+    if (retLexicons != null)
+      Collections.sort(retLexicons);
     return retLexicons;
   }