Package ca.cgjennings.algo
Interface TextIndexer.TextMapper
-
- All Known Implementing Classes:
TextIndexer.DefaultTextMapper
- Enclosing class:
- TextIndexer
public static interface TextIndexer.TextMapper
A text mapper maps an identifier to a source text to be indexed. It also allows you to substitute the source ID used to locate the text during indexing with another ID used to locate the text when using the index later. For example, you could use a local copy of a Web site to create an index, and substitute the URL of the online version of the Web site within the index.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getIndexID(java.lang.String sourceID)
Maps a source identifier to an index identifier.java.lang.String
getText(java.lang.String sourceID)
Given a source ID, return the text associated with that ID.
-
-
-
Method Detail
-
getText
java.lang.String getText(java.lang.String sourceID) throws java.io.IOException
Given a source ID, return the text associated with that ID.- Parameters:
sourceID
- an identifier that the mapper uses to locate the text- Returns:
- the text mapped to by the ID
- Throws:
java.io.IOException
- if an I/O error occurs while fetching the document
-
getIndexID
java.lang.String getIndexID(java.lang.String sourceID)
Maps a source identifier to an index identifier. If the source ID should be identified differently in the index, this returns the version to include in the index.- Parameters:
sourceID
- the ID used to locate the text during indexing- Returns:
- the ID used to locate the text when using the index
-
-