|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lenya.lucene.ReTokenizeFile
public class ReTokenizeFile
DOCUMENT ME!
Constructor Summary | |
---|---|
ReTokenizeFile()
|
Method Summary | |
---|---|
java.lang.String |
emphasizeAsXML(java.lang.String string,
java.lang.String[] words)
Encloses all words in words that appear in string in
<word> tags. |
java.lang.String |
getExcerpt(java.io.File file,
java.lang.String[] words)
|
protected java.lang.String |
includeInCDATA(java.lang.String string)
Includes a string in CDATA delimiters. |
static void |
main(java.lang.String[] args)
DOCUMENT ME! |
protected java.lang.String |
readFile(java.io.File file,
java.nio.charset.Charset charset)
reads a file in the specified encoding. |
protected java.lang.String |
readFileWithEncoding(java.io.File file)
reads a file and if the file is an xml file, determine its encoding |
protected java.lang.String |
readHtmlFile(java.io.File file)
read a html file. |
java.lang.String |
removeTags(java.lang.String string)
Remove tags |
java.lang.String |
reTokenize(java.io.File file)
DOCUMENT ME! |
void |
setOffset(int offset)
Set offset |
java.lang.String |
tidy(java.lang.String string)
Is being used by search-and-results.xsp. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReTokenizeFile()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- DOCUMENT ME!public java.lang.String reTokenize(java.io.File file) throws java.lang.Exception
file
- DOCUMENT ME!
java.lang.Exception
- DOCUMENT ME!public java.lang.String getExcerpt(java.io.File file, java.lang.String[] words) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public java.lang.String removeTags(java.lang.String string)
string
- Content with tags
public java.lang.String tidy(java.lang.String string)
string
- content
public java.lang.String emphasizeAsXML(java.lang.String string, java.lang.String[] words)
words
that appear in string
in
<word> tags. The whole string is enclosed in <excerpt> tags.
string
- The string to process.words
- The words to emphasize.
protected java.lang.String includeInCDATA(java.lang.String string)
protected java.lang.String readFileWithEncoding(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
file
- the file to read.
(if the file is an xml file with an specified encoding, this will be overwritten)
java.io.FileNotFoundException
java.io.IOException
protected java.lang.String readHtmlFile(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
file
- the file to read
java.io.FileNotFoundException
- if the file does not exists.
java.io.IOException
- if something else went wrong.protected java.lang.String readFile(java.io.File file, java.nio.charset.Charset charset) throws java.io.FileNotFoundException, java.io.IOException
file
- the file to read.encoding
- the file encoding
java.io.FileNotFoundException
- if the file does not exists.
java.io.IOException
- if something else went wrong.public void setOffset(int offset)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |