So the answer is we should use the "addpageto_index" procedure we just defined,
and we should pass in the index.
We should pass in the page, that's the URL that identifies the location,
and we should pass in the content.
And that's all we need.
So we're done with our web crawler.
From a seed, we can find a set of pages.
Following that seed, following all the links that we find on the pages that we find starting from that seed,
for each page, we're going to add the content that we find on that page to an index,
and we're going to return that index.
And we've already written a code that given the index, can do a lookup.
So for any word we want to look up, we'll find the list of URLs for the pages that contain that word.
Die Antwort lautet: wir verwenden das eben definierte "addpageto_index"-Procedure
und fügen den Index hinzu.
Wir fügen ebenfalls die Seite, d.h. die URL, die die Seite identifiziert,
und den Inhalt hinzu.
Das war´s.
Jetzt haben wir unseren Web Crawler.
Ausgehend von "seed" finden wir eine Reihe von Seiten.
Wir folgen der "seed", indem wir allen Links auf den Seiten ausgehend von "seed" folgen,
den Inhalt einer jeden Seite fügen wir einem Index hinzu,
dann lösen wir diesen Index mit return aus.
Wir haben bereits den Code definiert, der bei einem Index den Lookup auslöst.
So finden wir für jedes Wort, das wir nachschauen, eine Liste der URL´s der Seiten, die das Wort beinhalten.
La risposta è: dovremmo usare la procedura "addpageto_index" che abbiamo appena definito
alla quale dovremo passare l'indice
Dovremo passare la pagina, vale a dire l'URL che identifica l'indirizzo
quindi dovremo passare il contenuto
E' tutto quello che ci serve.
Quindi abbiamo finito il nostro web crawler
Da una pagina seme, possiamo trovare un insieme di pagine
seguendo quel seme, seguendo tutti i link che abbiamo trovato in quelle pagine trovate partendo da quella pagina seme,
per ciascuna pagina, aggiungeremo il contenuto trovato su quella pagina all'indice
e ritornermo quell'indice
Abbiamo già scritto del codice che, dato un indice, esegue una ricerca
Quindi per ogni parola che vogliamo cercare, troveremo la lista di URL delle pagine che contengono quella parola
答えは定義したばかりの
add_page_to_index関数を使うことです
indexを渡します
pageを渡します これが場所を特定するURLです
contentを渡します
必要なのはこれだけです
Webクローラを終了しました
シードページから一連のページを
見つけることができます
そのシードをたどるとシードから開始して
見つけたページで見つけたリンクすべてをたどります
各ページでそのページで見つけたコンテンツを
インデックスへ追加していきます
そのインデックスを返します
与えられたインデックスのコードをすでに書きました
lookupが使えます
どんな単語で検索してもその単語を含んだ
ページのURLリストを見つけます
答案就是 应使用刚刚定义的“addpageto_index”过程
传入索引
并传入网页 即定义位置的URL
还要传入内容
以上加起来就是全部所需内容
这样 我们就完成了网络爬虫
对于种子而言 我们可以找到一系列网页
循着该种子 及从该种子开始 在网页上找到的所有链接
我们可每个网页添加内容至索引
并返回该索引
我们已经写好编码 只要有指定索引 就开始开始搜索
因此 对于任何需要查找的词
我们都能找到URL链表 指向包含该词的页面
答案是,要使用剛才定義的 add-page-to-index 程序
我們必須傳入 index
要傳入 page,即識別位置的 url
還要傳入 content
這正是我們所需要的一切
這樣我們就完成了網頁蜘蛛
從種子頁面開始,我們可以找到一系列網頁
跟隨著種子頁面,從該種子頁面開始,
跟隨著網頁上找到的所有 links
對每一個頁面,我們將頁面裡的內容加到 index
我們會傳回 index
我們已經寫好程式碼,只要給了 index,就可以做查詢
因此對於任何需要查找的字組 (word),
我們都能找到包含該字組的頁面的 url 列表