Changeset 12390 in josm for trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java
- Timestamp:
- 2017-06-11T13:39:33+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java
r12283 r12390 235 235 } 236 236 237 /** 238 * A normalization that is applied to names before testing them 239 */ 237 240 @FunctionalInterface 238 241 public interface NormalizeRule { … … 246 249 } 247 250 251 /** 252 * A rule to replace by regular expression, 253 * so that all strings matching the regular expression are handled as if they were {@link RegExprRule#replacement} 254 */ 248 255 public static class RegExprRule implements NormalizeRule { 249 256 private final Pattern regExpr; 250 257 private final String replacement; 251 258 259 /** 260 * Create a new rule to replace by regular expression 261 * @param expression The regular expression 262 * @param replacement The replacement 263 */ 252 264 public RegExprRule(String expression, String replacement) { 253 265 this.regExpr = Pattern.compile(expression); … … 266 278 } 267 279 280 /** 281 * A rule that registers synonyms to a given word 282 */ 268 283 public static class SynonymRule implements NormalizeRule { 269 284 … … 272 287 private final String replacement; 273 288 289 /** 290 * Create a new {@link SynonymRule} 291 * @param replacement The word to use instead 292 * @param words The synonyms for that word 293 */ 274 294 public SynonymRule(String replacement, String... words) { 275 295 this.replacement = replacement.toLowerCase(Locale.ENGLISH);
Note:
See TracChangeset
for help on using the changeset viewer.