|
Regain 2.1.0-STABLE API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Preparator
Prepares a document for indexing. This is a read-only interface.
This is done by extracting the raw text from a document. In other words the document is stripped from formating information. Specific text parts like a title or a summary may be extracted as well.
The procedure of preparation is the following:
Pluggable.init(PreparatorConfig)
is called.accepts(RawDocument)
is called.true
was returned the actual preparation of the document
is made:
prepare(RawDocument)
is called. The preparator extracts
now all nessesary information.getCleanedContent()
, getHeadlines()
,
getPath()
, getSummary()
and getTitle()
.cleanUp()
is called. The preparator should release all
information about the current document in order to prepare the
next one.close()
is called.
Field Summary | |
---|---|
static int |
DEFAULT_BUFFER_SIZE
The default StringBuffer size that should be used for the content buffer. |
Method Summary | |
---|---|
boolean |
accepts(RawDocument rawDocument)
Gets whether the preparator is able to process the given document. |
void |
cleanUp()
Gibt alle Ressourcen frei, die für die Informationen über das Dokument reserviert wurden. |
void |
close()
Gibt alle Ressourcen frei, die von diesem Präparator genutzt wurden. |
Map<String,String> |
getAdditionalFields()
Gets additional fields that should be indexed. |
String |
getCleanedContent()
Gibt den von Formatierungsinformation befreiten Inhalt des Dokuments zurück. |
String |
getCleanedMetaData()
|
String |
getHeadlines()
Gibt die überschriften des Dokuments zurück. |
PathElement[] |
getPath()
Gibt den Pfad zurück, über den das Dokument zu erreichen ist. |
int |
getPriority()
Gets the priority of the preparator |
String |
getSummary()
Gibt eine Zusammenfassung für das Dokument zurück. |
String |
getTitle()
Gibt den Titel des Dokuments zurück. |
void |
prepare(RawDocument rawDocument)
Prepares a document for indexing. |
void |
setPriority(int priority)
Sets the priority of the preparator |
void |
setUrlRegex(org.apache.regexp.RE urlRegex)
Sets the regular expression a URL must match to, to be prepared by this preparator. |
Methods inherited from interface net.sf.regain.crawler.document.Pluggable |
---|
init |
Field Detail |
---|
static final int DEFAULT_BUFFER_SIZE
Method Detail |
---|
void setUrlRegex(org.apache.regexp.RE urlRegex)
urlRegex
- The new URL regex.accepts(RawDocument)
boolean accepts(RawDocument rawDocument)
rawDocument
- The document to check.
setUrlRegex(RE)
void prepare(RawDocument rawDocument) throws RegainException
rawDocument
- The document to prepare.
RegainException
- If preparing the document failed.String getTitle()
Falls kein Titel extrahiert werden konnte, wird null
zurückgegeben.
String getCleanedContent()
String getCleanedMetaData()
String getSummary()
Falls es keine Zusammenfassung m�glich ist, wird null
zurückgegeben.
String getHeadlines()
Es handelt sich dabei nicht um die überschrift des Dokuments selbst, sondern lediglich um Unter-überschriften, die in dem Dokument verwendendet werden. Mit Hilfe dieser überschriften l��t sich eine bessere Relevanz berechnen.
Wenn keine überschriften gefunden wurden, dann wird null
zurückgegeben.
PathElement[] getPath()
Falls kein Pfad verfügbar ist, wird null
zurückgegeben.
Map<String,String> getAdditionalFields()
These fields will be indexed and stored.
null
.void cleanUp()
Wird am Ende der Bearbeitung eines Dokuments aufgerufen, also nachdem die Getter abgefragt wurden.
void close() throws RegainException
Wird ganz am Ende des Crawler-Prozesses aufgerufen, nachdem alle Dokumente bearbeitet wurden.
RegainException
- Wenn der Präparator nicht geschlossen werden konnte.int getPriority()
void setPriority(int priority)
priority
- read from config or default value settings
|
Regain 2.1.0-STABLE API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |