Mercurial > hg > mpdl-group
comparison software/mpdl-services/mpiwg-mpdl-lt/src/de/mpg/mpiwg/berlin/mpdl/lt/dict/app/Lexicon.java @ 23:e845310098ba
diverse Korrekturen
author | Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 27 Nov 2012 12:35:19 +0100 |
parents | 7d6d969b10cf |
children |
comparison
equal
deleted
inserted
replaced
22:6a45a982c333 | 23:e845310098ba |
---|---|
8 import org.apache.commons.lang3.StringEscapeUtils; | 8 import org.apache.commons.lang3.StringEscapeUtils; |
9 | 9 |
10 import de.mpg.mpiwg.berlin.mpdl.exception.ApplicationException; | 10 import de.mpg.mpiwg.berlin.mpdl.exception.ApplicationException; |
11 import de.mpg.mpiwg.berlin.mpdl.lt.general.Language; | 11 import de.mpg.mpiwg.berlin.mpdl.lt.general.Language; |
12 import de.mpg.mpiwg.berlin.mpdl.lt.text.transcode.Transcoder; | 12 import de.mpg.mpiwg.berlin.mpdl.lt.text.transcode.Transcoder; |
13 import de.mpg.mpiwg.berlin.mpdl.util.StringUtils; | |
13 | 14 |
14 public class Lexicon implements Comparable<Lexicon> { | 15 public class Lexicon implements Comparable<Lexicon> { |
15 private String name; | 16 private String name; |
16 private String sourceLang; | 17 private String sourceLang; |
17 private String description; | 18 private String description; |
25 this.type = "local"; // default is local | 26 this.type = "local"; // default is local |
26 this.entries = new Hashtable<String, LexiconEntry>(); | 27 this.entries = new Hashtable<String, LexiconEntry>(); |
27 } | 28 } |
28 | 29 |
29 public int compareTo(Lexicon l) { | 30 public int compareTo(Lexicon l) { |
30 return name.compareTo(l.name); | 31 if (description != null) |
32 return description.compareTo(l.description); | |
33 else | |
34 return name.compareTo(l.name); | |
31 } | 35 } |
32 | 36 |
33 public String getName() { | 37 public String getName() { |
34 return name; | 38 return name; |
35 } | 39 } |
193 originalEntry = StringEscapeUtils.escapeXml(originalEntry); // create text version of the invalid xml content | 197 originalEntry = StringEscapeUtils.escapeXml(originalEntry); // create text version of the invalid xml content |
194 result = result + originalEntry; | 198 result = result + originalEntry; |
195 } | 199 } |
196 result = result + "</content>"; | 200 result = result + "</content>"; |
197 } | 201 } |
198 if (entry.getRemoteUrl() != null) | 202 if (entry.getRemoteUrl() != null) { |
199 result = result + "<remoteUrl>" + entry.getRemoteUrl() + "</remoteUrl>"; | 203 String remoteUrl = entry.getRemoteUrl(); |
204 remoteUrl = StringEscapeUtils.escapeXml(remoteUrl); | |
205 result = result + "<remoteUrl>" + remoteUrl + "</remoteUrl>"; | |
206 } | |
200 result = result + "</entry>"; | 207 result = result + "</entry>"; |
201 } | 208 } |
202 result = result + "</entries>"; | 209 result = result + "</entries>"; |
203 result = result + "</dictionary>"; | 210 result = result + "</dictionary>"; |
204 return result; | 211 return result; |