MCPcopy Create free account
hub / github.com/apache/nutch / normalize

Method normalize

src/java/org/apache/nutch/net/URLNormalizers.java:307–322  ·  view source on GitHub ↗

Normalize @param urlString The URL string to normalize. @param scope The given scope. @return A normalized String, using the given scope @throws MalformedURLException If the given URL string is malformed.

(String urlString, String scope)

Source from the content-addressed store, hash-verified

305 * If the given URL string is malformed.
306 */
307 public String normalize(String urlString, String scope)
308 throws MalformedURLException {
309 // optionally loop several times, and break if no further changes
310 String initialString = urlString;
311 for (int k = 0; k < loopCount; k++) {
312 for (int i = 0; i < this.normalizers.length; i++) {
313 if (urlString == null)
314 return null;
315 urlString = this.normalizers[i].normalize(urlString, scope);
316 }
317 if (initialString.equals(urlString))
318 break;
319 initialString = urlString;
320 }
321 return urlString;
322 }
323}

Callers 2

testURLNormalizersMethod · 0.95
checkAllMethod · 0.95

Calls 2

normalizeMethod · 0.65
equalsMethod · 0.45

Tested by 1

testURLNormalizersMethod · 0.76