package projet;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;
import javax.swing.text.BadLocationException;
import javax.swing.text.EditorKit;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.html.HTML;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLEditorKit;
public class robot {
@SuppressWarnings("unchecked" )
HashMap<String, ArrayList> Index ;
@SuppressWarnings("unchecked" )
public robot () {
Index = new HashMap<String, ArrayList> ();
}
@SuppressWarnings("unchecked" )
//Charger la page
//lire le document HTML
doc.
putProperty("IgnoreCharsetDirective",
new Boolean(true));
kit.read(rd, doc, 0);
//Parcourir la balise lien
while (it.isValid()) {
if (link != null && link.startsWith("http" ) && link.endsWith(".html" )) {
//découpage des mots du titre du lien corespondant
if(Nom!=null){
ArrayList<String> tmp2 = new ArrayList<String> () ;
while (tmp.hasMoreTokens()){
if(tmp3.length()>2)
tmp2.add(tmp3);
}
Index.put(link, tmp2);
}
}
it.next();
}
return Index;
}
}