     currentTask?.resume()
   }
 
-  func parse(document: String, url: Foundation.URL) {
+  /// Parses the given document.
+  ///
+  /// - Parameters:
+  ///   - document: The content to parse.
+  ///   - url: The url associated with the document.
+  func parse(document: String, url: URL) {
     func find(word: String, from document: String) {
       guard document.contains(word) else { return }
       wordFoundCallback(url)
     }
 
-    func collectLinks(from document: String) -> [Foundation.URL] {
+    func collectLinks(from document: String) -> [URL] {
       let types: NSTextCheckingResult.CheckingType = .link
       let detector = try? NSDataDetector(types: types.rawValue)
       let range = NSRange(0..<document.count)


import Foundation

public class Crawler {
  let maximumPagesToVisit: Int
  let wordToSearch: String
  var visitedPages: Set<URL> = []
  var pagesToVisit: Set<URL>
  let visitingCallback: ((URL) -> Void)?
  let wordFoundCallback: (URL) -> Void
  let completion: (Int) -> Void
  var currentTask: URLSessionDataTask?

  public init(
    startURL: URL,
    maximumPagesToVisit: Int,

    }
  }

  /// Tells the crawler to visit the given `url` page.
  /// - Parameter url: The page we want to visit.
  func visit(page url: URL) {
    visitedPages.insert(url)

    currentTask = URLSession.shared.dataTask(with: url) { [weak self] data, _, _ in
