Changeset 4575
- Timestamp:
- 02/25/14 15:05:49 (10 years ago)
- Location:
- vlo/branches/vlo-3.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-3.0/vlo-commons/src/main/resources/facetConcepts.xml
r4557 r4575 94 94 <concept>http://www.isocat.org/datcat/DC-5361</concept> <!-- language usage (TEI) --> 95 95 <concept>http://www.isocat.org/datcat/DC-5358</concept> <!--language (TEI) - MENZO: added for CLARIN-DK --> 96 97 <concept>http://purl.org/dc/terms/language</concept> 96 98 <!-- Had to be removed due to IDSAGD_Speaker <acceptableContext includeAny="false" includeEmpty="true"/> 97 99 <rejectableContext includeAny="true" includeEmpty="false"> … … 126 128 <concept>http://www.isocat.org/datcat/DC-5361</concept> <!-- language usage (TEI) --> 127 129 <concept>http://www.isocat.org/datcat/DC-5358</concept> <!--language (TEI) - MENZO: added for CLARIN-DK --> 130 131 <concept>http://purl.org/dc/terms/language</concept> 128 132 <!-- Had to be removed due to IDSAGD_Speaker <acceptableContext includeAny="false" includeEmpty="true"/> 129 133 <rejectableContext includeAny="true" includeEmpty="false"> -
vlo/branches/vlo-3.0/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/LanguageCodePostProcessor.java
r4507 r4575 32 32 private Map<String, String> languageNameToIso639Map; 33 33 private Map<String, String> iso639ToLanguageNameMap; 34 private Map<String, String> iso639_2TToISO639_3Map; 34 35 35 36 /** … … 73 74 } 74 75 } 76 77 // convert ISO 639-2/T codes to ISO 639-3 78 if (getIso6392TToISO6393Map().containsKey(value.toUpperCase())) { 79 result = getIso6392TToISO6393Map().get(value.toUpperCase()); 80 } 81 75 82 // Convert to lowercase to capture erroneously capitalized language codes in the CMDI files. 76 83 // NOTE: In the mappings themselves we do not capitalize. … … 122 129 123 130 return iso639ToLanguageNameMap; 131 } 132 133 /** 134 * Returns map of ISO 639-2/B codes to ISO 639-3 135 * 136 * It is strongly advised to use ISO 639-3 codes, the support for ISO 639-2 may be discontinued in the future 137 * 138 * @return map of ISO 639-2/B codes to ISO 639-3 139 */ 140 private Map<String, String> getIso6392TToISO6393Map() { 141 if (iso639_2TToISO639_3Map == null) { 142 iso639_2TToISO639_3Map = new HashMap<String, String>(); 143 iso639_2TToISO639_3Map.put("ALB", "SQI"); 144 iso639_2TToISO639_3Map.put("ARM", "HYE"); 145 iso639_2TToISO639_3Map.put("BAQ", "EUS"); 146 iso639_2TToISO639_3Map.put("BUR", "MYA"); 147 iso639_2TToISO639_3Map.put("CZE", "CES"); 148 iso639_2TToISO639_3Map.put("CHI", "ZHO"); 149 iso639_2TToISO639_3Map.put("DUT", "NLD"); 150 iso639_2TToISO639_3Map.put("FRE", "FRA"); 151 iso639_2TToISO639_3Map.put("GEO", "KAT"); 152 iso639_2TToISO639_3Map.put("GER", "DEU"); 153 iso639_2TToISO639_3Map.put("GRE", "ELL"); 154 iso639_2TToISO639_3Map.put("ICE", "ISL"); 155 iso639_2TToISO639_3Map.put("MAC", "MKD"); 156 iso639_2TToISO639_3Map.put("MAO", "MRI"); 157 iso639_2TToISO639_3Map.put("MAY", "MSA"); 158 iso639_2TToISO639_3Map.put("PER", "FAS"); 159 iso639_2TToISO639_3Map.put("RUM", "RON"); 160 iso639_2TToISO639_3Map.put("SLO", "SLK"); 161 iso639_2TToISO639_3Map.put("TIB", "BOD"); 162 iso639_2TToISO639_3Map.put("WEL", "CYM"); 163 } 164 165 return iso639_2TToISO639_3Map; 124 166 } 125 167 -
vlo/branches/vlo-3.0/vlo-importer/src/test/java/eu/clarin/cmdi/vlo/importer/LanguageCodePostProcessorTest.java
r4517 r4575 30 30 assertEquals("German", processor.process("RFC1766:x-sil-GER")); 31 31 assertEquals("RFC1766:sgn-NL", processor.process("RFC1766:sgn-NL")); 32 assertEquals("Basque", processor.process("baq")); 32 33 } 33 34
Note: See TracChangeset
for help on using the changeset viewer.