Mercurial > hg > mpdl-group
annotate 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 |
rev | line source |
---|---|
19 | 1 package de.mpg.mpiwg.berlin.mpdl.lt.dict.app; |
2 | |
3 import java.util.ArrayList; | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
4 import java.util.Collections; |
19 | 5 import java.util.HashMap; |
6 import java.util.Iterator; | |
7 import java.util.Set; | |
8 | |
9 import de.mpg.mpiwg.berlin.mpdl.lt.general.Language; | |
10 | |
11 /* | |
12 florio: 70091 records (6 of them are not xml valid) | |
13 bonitz: 14648 records (46 of them are not xml valid) | |
14 webster: 111733 records (3 of them are not xml valid) | |
15 ls: 53500 records (14 of them are not xml valid) | |
16 autenrieth: 10158 records (468 of them are not xml valid) | |
17 cooper: 33124 records (116 of them are not xml valid) | |
18 baretti: 53555 records (0 of them are not xml valid) | |
19 salmone: 6360 records (11 of them are not xml valid) | |
20 lsj: 112631 records (26922 of them are not xml valid) | |
21 */ | |
22 public class Lexica { | |
23 private static Lexica instance; | |
24 private static HashMap<String, Lexicon> localLexica = new HashMap<String, Lexicon>(); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
25 private static HashMap<String, String[]> localLangLexiconNames = new HashMap<String, String[]>(); |
19 | 26 private static HashMap<String, Lexicon> remoteLexica = new HashMap<String, Lexicon>(); |
27 | |
28 public static Lexica getInstance() { | |
29 if (instance == null) { | |
30 instance = new Lexica(); | |
31 instance.init(); | |
32 } | |
33 return instance; | |
34 } | |
35 | |
36 private void init() { | |
37 Lexicon autenrieth = new Lexicon("autenrieth", "el"); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
38 autenrieth.setDescription("Autenrieth: A Homeric lexicon"); |
19 | 39 autenrieth.setQueryUrl("http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.04.0073:entry="); |
40 Lexicon baretti = new Lexicon("baretti", "it"); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
41 baretti.setDescription("Baretti: A dictionary of the English and Italian languages"); |
19 | 42 Lexicon bonitz = new Lexicon("bonitz", "el"); |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
43 bonitz.setDescription("Bonitz: Index Aristotelicus"); |
19 | 44 Lexicon cooper = new Lexicon("cooper", "la"); |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
45 cooper.setDescription("Cooper: Thesaurus Linguae Romanae et Brittanicae"); |
19 | 46 Lexicon florio = new Lexicon("florio", "it"); |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
47 florio.setDescription("Florio: a worlde of wordes, or most copious, dictionarie in Italian and English"); |
19 | 48 Lexicon ls = new Lexicon("ls", "la"); |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
49 ls.setDescription("Lewis and Short: Latin dictionary"); |
19 | 50 ls.setQueryUrl("http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.04.0059:entry="); |
51 Lexicon lsj = new Lexicon("lsj", "el"); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
52 lsj.setDescription("Liddell-Scott-Jones: A Greek-English lexicon"); |
19 | 53 lsj.setQueryUrl("http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.04.0057:entry="); |
54 Lexicon salmone = new Lexicon("salmone", "ar"); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
55 salmone.setDescription("Salmone: An advanced learner's Arabic-English dictionary"); |
19 | 56 salmone.setQueryUrl("http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:2002.02.0005:entry="); |
57 Lexicon webster = new Lexicon("webster", "en"); | |
58 webster.setDescription("Webster's revised unabridged dictionary (1913)"); | |
59 localLexica.put("autenrieth", autenrieth); | |
60 localLexica.put("baretti", baretti); | |
61 localLexica.put("bonitz", bonitz); | |
62 localLexica.put("cooper", cooper); | |
63 localLexica.put("florio", florio); | |
64 localLexica.put("ls", ls); | |
65 localLexica.put("lsj", lsj); | |
66 localLexica.put("salmone", salmone); | |
67 localLexica.put("webster", webster); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
68 localLangLexiconNames = new HashMap<String, String[]>(); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
69 String[] arLangLexNames = {"salmone"}; |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
70 localLangLexiconNames.put("ar", arLangLexNames); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
71 String[] elLangLexNames = {"autenrieth", "bonitz", "lsj"}; |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
72 localLangLexiconNames.put("el", elLangLexNames); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
73 String[] enLangLexNames = {"webster"}; |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
74 localLangLexiconNames.put("en", enLangLexNames); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
75 String[] itLangLexNames = {"baretti", "florio"}; |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
76 localLangLexiconNames.put("it", itLangLexNames); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
77 String[] laLangLexNames = {"cooper", "ls"}; |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
78 localLangLexiconNames.put("la", laLangLexNames); |
19 | 79 Lexicon dwds = new Lexicon("dwds", "de"); |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
80 dwds.setDescription("DWDS: Deutsches Wšrterbuch der deutschen Sprache"); |
19 | 81 dwds.setQueryUrl("http://www.dwds.de/search/?qu="); |
82 dwds.setType("remote"); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
83 Lexicon leoDE = new Lexicon("leoDE", "de"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
84 leoDE.setDescription("LEO: German - English Dictionary"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
85 leoDE.setQueryUrl("http://dict.leo.org/ende?lang=en&search="); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
86 leoDE.setType("remote"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
87 Lexicon dictLeipzigDE = new Lexicon("dictLeipzigDE", "de"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
88 dictLeipzigDE.setDescription("UniversitŠt Leipzig: German - English Dictionary"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
89 dictLeipzigDE.setQueryUrl("http://dict.uni-leipzig.de/index.php?wort="); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
90 dictLeipzigDE.setType("remote"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
91 Lexicon lingueeDE = new Lexicon("lingueeDE", "de"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
92 lingueeDE.setDescription("Linguee: German - English Dictionary"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
93 lingueeDE.setQueryUrl("http://www.linguee.de/deutsch-englisch/search?query="); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
94 lingueeDE.setType("remote"); |
19 | 95 Lexicon slater = new Lexicon("slater", "el"); |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
96 slater.setDescription("William J. Slater: Lexicon to Pindar"); |
19 | 97 slater.setQueryUrl("http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.04.0072:entry="); |
98 slater.setType("remote"); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
99 Lexicon leoEN = new Lexicon("leoEN", "en"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
100 leoEN.setDescription("LEO: German - English Dictionary"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
101 leoEN.setQueryUrl("http://dict.leo.org/ende?lang=en&search="); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
102 leoEN.setType("remote"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
103 Lexicon lingueeEN = new Lexicon("lingueeEN", "en"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
104 lingueeEN.setDescription("Linguee: German - English Dictionary"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
105 lingueeEN.setQueryUrl("http://www.linguee.de/deutsch-englisch/search?query="); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
106 lingueeEN.setType("remote"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
107 Lexicon leoFR = new Lexicon("leoFR", "fr"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
108 leoFR.setDescription("LEO: German - French Dictionary"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
109 leoFR.setQueryUrl("http://dict.leo.org/frde?lang=en&search="); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
110 leoFR.setType("remote"); |
19 | 111 Lexicon artflFr = new Lexicon("artfl-fr", "fr"); |
112 artflFr.setDescription("The ARTFL project: Dictionnaires d'autrefois: French dictionaries of the 17th, 18th, 19th and 20th centuries"); | |
113 artflFr.setQueryUrl("http://machaut.uchicago.edu/?resource=frengdict&action=search&french="); | |
114 artflFr.setType("remote"); | |
115 Lexicon artflFrEn = new Lexicon("artfl-fr-en", "fr"); | |
116 artflFrEn.setDescription("The ARTFL project: French - English dictionary"); | |
117 artflFrEn.setQueryUrl("http://artflx.uchicago.edu/cgi-bin/dicos/pubdico1look.pl?strippedhw="); | |
118 artflFrEn.setType("remote"); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
119 Lexicon leoIT = new Lexicon("leoIT", "it"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
120 leoIT.setDescription("LEO: German - Italian Dictionary"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
121 leoIT.setQueryUrl("http://dict.leo.org/itde?lang=en&search="); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
122 leoIT.setType("remote"); |
19 | 123 Lexicon lewis = new Lexicon("lewis", "la"); |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
124 lewis.setDescription("Charlton T. Lewis: An Elementary Latin Dictionary"); |
19 | 125 lewis.setQueryUrl("http://www.perseus.tufts.edu/hopper/text?doc=Perseus:text:1999.04.0060:entry="); |
126 lewis.setType("remote"); | |
127 Lexicon wikiwoordenboek = new Lexicon("wikiwoordenboek", "nl"); | |
128 wikiwoordenboek.setDescription("Wiktionary: WikiWoordenboek"); | |
129 wikiwoordenboek.setQueryUrl("http://nl.wiktionary.org/wiki/"); | |
130 wikiwoordenboek.setType("remote"); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
131 Lexicon leoCH = new Lexicon("leoCH", "ch"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
132 leoCH.setDescription("LEO: German - Chinese Dictionary"); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
133 leoCH.setQueryUrl("http://dict.leo.org/chde?lang=en&search="); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
134 leoCH.setType("remote"); |
19 | 135 Lexicon ctp = new Lexicon("ctp", "zh"); |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
136 ctp.setDescription("Chinese Text Project: Chinese - English Dictionary"); |
19 | 137 ctp.setQueryUrl("http://ctext.org/dictionary.pl?if=en&char="); |
138 ctp.setType("remote"); | |
139 Lexicon linyutan = new Lexicon("linyutan", "zh"); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
140 linyutan.setDescription("Lin Yutang: Chinese - English Dictionary"); |
19 | 141 linyutan.setQueryUrl("http://humanum.arts.cuhk.edu.hk/cgi-bin/agrep-lindict?query="); |
142 linyutan.setType("remote"); | |
143 Lexicon chineseUnicode = new Lexicon("chinese-unicode", "zh"); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
144 chineseUnicode.setDescription("Unicode.org: Chinese - English"); |
19 | 145 chineseUnicode.setQueryUrl("http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint="); |
146 chineseUnicode.setType("remote"); | |
147 Lexicon chineseWiktionary = new Lexicon("chinese-wiktionary", "zh"); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
148 chineseWiktionary.setDescription("Wiktionary: Chinese - English"); |
19 | 149 chineseWiktionary.setQueryUrl("http://en.wiktionary.org/wiki/"); |
150 chineseWiktionary.setType("remote"); | |
151 remoteLexica.put("dwds", dwds); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
152 remoteLexica.put("leoDE", leoDE); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
153 remoteLexica.put("dictLeipzigDE", dictLeipzigDE); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
154 remoteLexica.put("lingueeDE", lingueeDE); |
19 | 155 remoteLexica.put("slater", slater); |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
156 remoteLexica.put("leoEN", leoEN); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
157 remoteLexica.put("lingueeEN", lingueeEN); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
158 remoteLexica.put("leoFR", leoFR); |
19 | 159 remoteLexica.put("artfl-fr", artflFr); |
160 remoteLexica.put("artfl-fr-en", artflFrEn); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
161 remoteLexica.put("leoIT", leoIT); |
19 | 162 remoteLexica.put("lewis", lewis); |
163 remoteLexica.put("wikiwoordenboek", wikiwoordenboek); | |
164 remoteLexica.put("ctp", ctp); | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
165 remoteLexica.put("leoCH", leoCH); |
19 | 166 remoteLexica.put("linyutan", linyutan); |
167 remoteLexica.put("chinese-unicode", chineseUnicode); | |
168 remoteLexica.put("chinese-wiktionary", chineseWiktionary); | |
169 } | |
170 | |
171 public Lexicon getLexicon(String name) { | |
172 Lexicon lexicon = localLexica.get(name); | |
173 if (lexicon == null) | |
174 lexicon = remoteLexica.get(name); | |
175 return lexicon; | |
176 } | |
177 | |
178 public ArrayList<Lexicon> getLocalLexicons(String lang) { | |
179 String language = Language.getInstance().getLanguageId(lang); | |
180 ArrayList<Lexicon> retLexicons = null; | |
181 Set<String> keys = localLexica.keySet(); | |
182 Iterator<String> it = keys.iterator(); | |
183 while (it.hasNext()) { | |
184 String lexName = it.next(); | |
185 Lexicon lexicon = localLexica.get(lexName); | |
186 String sourceLanguage = lexicon.getSourceLanguage(); | |
187 if (sourceLanguage != null && sourceLanguage.equals(language)) { | |
188 if (retLexicons == null) | |
189 retLexicons = new ArrayList<Lexicon>(); | |
190 retLexicons.add(lexicon); | |
191 } | |
192 } | |
193 return retLexicons; | |
194 } | |
195 | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
196 public String[] getLocalLexiconNames(String lang) { |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
197 String language = Language.getInstance().getLanguageId(lang); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
198 String[] retLexiconNames = localLangLexiconNames.get(language); |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
199 return retLexiconNames; |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
200 } |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
201 |
19 | 202 public ArrayList<Lexicon> getRemoteLexicons(String lang) { |
203 String language = Language.getInstance().getLanguageId(lang); | |
204 ArrayList<Lexicon> retLexicons = null; | |
205 Set<String> keys = remoteLexica.keySet(); | |
206 Iterator<String> it = keys.iterator(); | |
207 while (it.hasNext()) { | |
208 String lexName = it.next(); | |
209 Lexicon lexicon = remoteLexica.get(lexName); | |
210 String sourceLanguage = lexicon.getSourceLanguage(); | |
211 if (sourceLanguage != null && sourceLanguage.equals(language)) { | |
212 if (retLexicons == null) | |
213 retLexicons = new ArrayList<Lexicon>(); | |
214 retLexicons.add(lexicon); | |
215 } | |
216 } | |
23
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
217 if (retLexicons != null) |
e845310098ba
diverse Korrekturen
Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
parents:
19
diff
changeset
|
218 Collections.sort(retLexicons); |
19 | 219 return retLexicons; |
220 } | |
221 | |
222 public ArrayList<Lexicon> getLexicons(String lang) { | |
223 ArrayList<Lexicon> retLexicons = new ArrayList<Lexicon>(); | |
224 ArrayList<Lexicon> localLexicons = getLocalLexicons(lang); | |
225 if (localLexicons != null) { | |
226 retLexicons.addAll(localLexicons); | |
227 } | |
228 ArrayList<Lexicon> remoteLexicons = getRemoteLexicons(lang); | |
229 if (remoteLexicons != null) { | |
230 retLexicons.addAll(remoteLexicons); | |
231 } | |
232 return retLexicons; | |
233 } | |
234 | |
235 public ArrayList<Lexicon> getLocalLexicons() { | |
236 ArrayList<Lexicon> retLexicons = null; | |
237 Set<String> keys = localLexica.keySet(); | |
238 Iterator<String> it = keys.iterator(); | |
239 while (it.hasNext()) { | |
240 String lexName = it.next(); | |
241 Lexicon lexicon = localLexica.get(lexName); | |
242 if (retLexicons == null) | |
243 retLexicons = new ArrayList<Lexicon>(); | |
244 retLexicons.add(lexicon); | |
245 } | |
246 return retLexicons; | |
247 } | |
248 | |
249 public ArrayList<Lexicon> getLocalBetacodeLexicons() { | |
250 ArrayList<Lexicon> retLexicons = new ArrayList<Lexicon>(); | |
251 retLexicons.add(localLexica.get("autenrieth")); | |
252 retLexicons.add(localLexica.get("bonitz")); | |
253 retLexicons.add(localLexica.get("lsj")); | |
254 return retLexicons; | |
255 } | |
256 | |
257 public ArrayList<Lexicon> getLocalBuckwalterLexicons() { | |
258 ArrayList<Lexicon> retLexicons = new ArrayList<Lexicon>(); | |
259 retLexicons.add(localLexica.get("salmone")); | |
260 return retLexicons; | |
261 } | |
262 | |
263 } | |
264 | |
265 /* TODO | |
266 <option value="dwds">Das Digitale Wörterbuch der deutschen Sprache</option> | |
267 <option value="grimm">Deutsches Wörterbuch von J. und W. Grimm (experimental)</option> | |
268 <option value="artfl">Dictionnaire de l'Académie francaise, 4e éd. (1762)</option> | |
269 <option value="epsd">Pennsylvania Sumerian Dictionary</option> | |
270 | |
271 else if (dictname == "dwds") lang="de"; | |
272 else if (dictname == "grimm") lang="de"; | |
273 else if (dictname == "artfl") lang="fr"; | |
274 else of (dictname == "epsd") lang="sux"; | |
275 | |
276 DWDS: | |
277 | |
278 Link: http://www.dwds.de/?woerterbuch=1&qu=auto | |
279 Logo: http://www.dwds.de/images/dwds_logo.gif | |
280 Copyright: Copyright © by Berlin-Brandenburgische Akademie der Wissenschaften, Wörterbuch der deutschen Gegenwartssprache, all rights reserved. | |
281 | |
282 Grimm: | |
283 | |
284 Link: http://germa63.uni-trier.de:8080/Projects/WBB/woerterbuecher/dwb/report_lemma?wb=G&word=auto | |
285 View: http://germa63.uni-trier.de:8080/Projects/WBB/woerterbuecher/dwb/selectarticles?lemid= | |
286 Output: | |
287 <html> | |
288 <head> | |
289 <title>Deutsches Wörterbuch von Jacob und Wilhelm Grimm</title> | |
290 <link rel="stylesheet" href="http://germa63.uni-trier.de:8080/Projects/WBB/woerterbuecher/dwb/styles_wbb" type="text/css"></link> | |
291 <link rel="stylesheet" href="http://germa63.uni-trier.de:8080/Projects/WBB/woerterbuecher/dwb/styles_add" type="text/css"></link> | |
292 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"></META> | |
293 </head> | |
294 <body> | |
295 | |
296 ARTFL: | |
297 | |
298 Name: Dictionnaire de l'Académie francaise, 4e éd. | |
299 Vorverarbeitung des Wortes yourWord: $word =~ s/%([0-9A-F]{2})/pack("H2", $1)/ge; | |
300 Link: http://colet.uchicago.edu/cgi-bin/dico1look.pl?dicoid=ACAD1762&strippedhw=yourWord | |
301 | |
302 EPSD: | |
303 | |
304 Name: ePSD (Pennsylvania Sumerian Dictionary) | |
305 Link: http://psd.museum.upenn.edu/cgi-bin/epsd.plx?x=epsd&q=yourWord | |
306 | |
307 | |
308 | |
309 */ |