|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Classifier interface. A classifier is a helper object that annotates pages and links with labels (using Page.setLabel() and Link.setLabel()). When a page is retrieved by a crawler, it is passed to the classify() method of every Classifier registered with the crawler. Here are some typical uses for classifiers:
Method Summary | |
void |
classify(Page page)
Classify a page. |
float |
getPriority()
Get priority of this classifier. |
Method Detail |
public void classify(Page page)
page
- Page to classifypublic float getPriority()
priority
so that classifiers that depend on it can compute their
priorities statically. For example, if your classifier
depends on FooClassifier and BarClassifier, you might set your
priority as:
public static final float priority = Math.max (FooClassifier, BarClassifier) + 1; public float getPriority () { return priority; }
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |