Changeset 4016
- Timestamp:
- 11/13/13 14:24:31 (11 years ago)
- Location:
- vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/FacetConceptMapping.java
r3933 r4016 97 97 private List<String> patterns = new ArrayList<String>(); 98 98 99 @XmlElement(name = "blacklistPattern") 100 private List<String> blacklistPatterns = new ArrayList<String>(); 101 99 102 public void setConcepts(List<String> concepts) { 100 103 this.concepts = concepts; … … 171 174 public List<String> getPatterns() { 172 175 return patterns; 176 } 177 178 public void setBlacklistPatterns(List<String> blacklistPatterns) { 179 this.blacklistPatterns = blacklistPatterns; 180 } 181 182 public List<String> getBlacklistPatterns() { 183 return blacklistPatterns; 173 184 } 174 185 -
vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/FacetMappingFactory.java
r4003 r4016 131 131 } 132 132 } 133 134 //add hardcoded patterns only when there is no xpath generated from conceptlink 133 135 if (xpaths.isEmpty()) { 134 //add hardcoded patterns only when there is no xpath generated from conceptlink135 136 xpaths.addAll(facetConcept.getPatterns()); 136 137 } 138 139 // pattern-based blacklisting: remove all XPath expressions that contain a blacklisted substring; 140 // this is basically a hack to enhance the quality of the visualised information in the VLO; 141 // should be replaced by a more intelligent approach in the future 142 for(String blacklistPattern : facetConcept.getBlacklistPatterns()) { 143 Iterator<String> xpathIterator = xpaths.iterator(); 144 while(xpathIterator.hasNext()) { 145 String xpath = xpathIterator.next(); 146 if(xpath.contains(blacklistPattern)) { 147 LOG.debug("Rejecting "+xpath+" because of blacklisted substring "+blacklistPattern); 148 xpathIterator.remove(); 149 } 150 } 151 } 152 137 153 config.setCaseInsensitive(facetConcept.isCaseInsensitive()); 138 154 config.setAllowMultipleValues(facetConcept.isAllowMultipleValues());
Note: See TracChangeset
for help on using the changeset viewer.