Java Doc for Highlighter.java in  » ERP-CRM-Financial » sakai » org » apache » lucene » search » highlight » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » sakai » org.apache.lucene.search.highlight 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.lucene.search.highlight.Highlighter

Highlighter
public class Highlighter (Code)
Class used to markup highlighted terms found in the best sections of a text, using configurable Fragmenter , Scorer , Formatter , Encoder and tokenizers.
author:
   mark@searcharea.co.uk


Field Summary
final public static  intDEFAULT_MAX_DOC_BYTES_TO_ANALYZE
    

Constructor Summary
public  Highlighter(Scorer fragmentScorer)
    
public  Highlighter(Formatter formatter, Scorer fragmentScorer)
    
public  Highlighter(Formatter formatter, Encoder encoder, Scorer fragmentScorer)
    

Method Summary
final public  StringgetBestFragment(Analyzer analyzer, String fieldName, String text)
     Highlights chosen terms in a text, extracting the most relevant section.
final public  StringgetBestFragment(TokenStream tokenStream, String text)
     Highlights chosen terms in a text, extracting the most relevant section. The document text is analysed in chunks to record hit statistics across the document.
final public  String[]getBestFragments(Analyzer analyzer, String text, int maxNumFragments)
     Highlights chosen terms in a text, extracting the most relevant sections. This is a convenience method that calls Highlighter.getBestFragments(TokenStream,String,int)
Parameters:
  analyzer - the analyzer that will be used to split text intochunks
Parameters:
  text - text to highlight terms in
Parameters:
  maxNumFragments - the maximum number of fragments.
final public  String[]getBestFragments(TokenStream tokenStream, String text, int maxNumFragments)
     Highlights chosen terms in a text, extracting the most relevant sections. The document text is analysed in chunks to record hit statistics across the document.
final public  StringgetBestFragments(TokenStream tokenStream, String text, int maxNumFragments, String separator)
     Highlights terms in the text , extracting the most relevant sections and concatenating the chosen fragments with a separator (typically "..."). The document text is analysed in chunks to record hit statistics across the document.
final public  TextFragment[]getBestTextFragments(TokenStream tokenStream, String text, boolean mergeContiguousFragments, int maxNumFragments)
     Low level api to get the most relevant (formatted) sections of the document.
public  EncodergetEncoder()
    
public  ScorergetFragmentScorer()
    
public  intgetMaxDocBytesToAnalyze()
    
public  FragmentergetTextFragmenter()
    
public  voidsetEncoder(Encoder encoder)
    
public  voidsetFragmentScorer(Scorer scorer)
    
public  voidsetMaxDocBytesToAnalyze(int byteCount)
    
public  voidsetTextFragmenter(Fragmenter fragmenter)
    

Field Detail
DEFAULT_MAX_DOC_BYTES_TO_ANALYZE
final public static int DEFAULT_MAX_DOC_BYTES_TO_ANALYZE(Code)




Constructor Detail
Highlighter
public Highlighter(Scorer fragmentScorer)(Code)



Highlighter
public Highlighter(Formatter formatter, Scorer fragmentScorer)(Code)



Highlighter
public Highlighter(Formatter formatter, Encoder encoder, Scorer fragmentScorer)(Code)




Method Detail
getBestFragment
final public String getBestFragment(Analyzer analyzer, String fieldName, String text) throws IOException(Code)
Highlights chosen terms in a text, extracting the most relevant section. This is a convenience method that calls Highlighter.getBestFragment(TokenStream,String)
Parameters:
  analyzer - the analyzer that will be used to split text intochunks
Parameters:
  text - text to highlight terms in
Parameters:
  fieldName - Name of field used to influence analyzer's tokenization policy highlighted text fragment or null if no terms found



getBestFragment
final public String getBestFragment(TokenStream tokenStream, String text) throws IOException(Code)
Highlights chosen terms in a text, extracting the most relevant section. The document text is analysed in chunks to record hit statistics across the document. After accumulating stats, the fragment with the highest score is returned
Parameters:
  tokenStream - a stream of tokens identified in the text parameter, includingoffset information. This is typically produced by an analyzerre-parsing a document's text. Some work may be done on retrievingTokenStreams more efficently by adding support for storingoriginal text position data in the Lucene index but this supportis not currently available (as of Lucene 1.4 rc2).
Parameters:
  text - text to highlight terms in highlighted text fragment or null if no terms found



getBestFragments
final public String[] getBestFragments(Analyzer analyzer, String text, int maxNumFragments) throws IOException(Code)
Highlights chosen terms in a text, extracting the most relevant sections. This is a convenience method that calls Highlighter.getBestFragments(TokenStream,String,int)
Parameters:
  analyzer - the analyzer that will be used to split text intochunks
Parameters:
  text - text to highlight terms in
Parameters:
  maxNumFragments - the maximum number of fragments. highlighted text fragments (between 0 and maxNumFragments numberof fragments)



getBestFragments
final public String[] getBestFragments(TokenStream tokenStream, String text, int maxNumFragments) throws IOException(Code)
Highlights chosen terms in a text, extracting the most relevant sections. The document text is analysed in chunks to record hit statistics across the document. After accumulating stats, the fragments with the highest scores are returned as an array of strings in order of score (contiguous fragments are merged into one in their original order to improve readability)
Parameters:
  text - text to highlight terms in
Parameters:
  maxNumFragments - the maximum number of fragments. highlighted text fragments (between 0 and maxNumFragments numberof fragments)



getBestFragments
final public String getBestFragments(TokenStream tokenStream, String text, int maxNumFragments, String separator) throws IOException(Code)
Highlights terms in the text , extracting the most relevant sections and concatenating the chosen fragments with a separator (typically "..."). The document text is analysed in chunks to record hit statistics across the document. After accumulating stats, the fragments with the highest scores are returned in order as "separator" delimited strings.
Parameters:
  text - text to highlight terms in
Parameters:
  maxNumFragments - the maximum number of fragments.
Parameters:
  separator - the separator used to intersperse the document fragments(typically "...") highlighted text



getBestTextFragments
final public TextFragment[] getBestTextFragments(TokenStream tokenStream, String text, boolean mergeContiguousFragments, int maxNumFragments) throws IOException(Code)
Low level api to get the most relevant (formatted) sections of the document. This method has been made public to allow visibility of score information held in TextFragment objects. Thanks to Jason Calabrese for help in redefining the interface.
Parameters:
  tokenStream -
Parameters:
  text -
Parameters:
  maxNumFragments -
Parameters:
  mergeContiguousFragments -
throws:
  IOException -



getEncoder
public Encoder getEncoder()(Code)



getFragmentScorer
public Scorer getFragmentScorer()(Code)
Object used to score each text fragment



getMaxDocBytesToAnalyze
public int getMaxDocBytesToAnalyze()(Code)
the maximum number of bytes to be tokenized per doc



getTextFragmenter
public Fragmenter getTextFragmenter()(Code)



setEncoder
public void setEncoder(Encoder encoder)(Code)



setFragmentScorer
public void setFragmentScorer(Scorer scorer)(Code)

Parameters:
  scorer -



setMaxDocBytesToAnalyze
public void setMaxDocBytesToAnalyze(int byteCount)(Code)

Parameters:
  byteCount - the maximum number of bytes to be tokenized per doc (This canimprove performance with large documents)



setTextFragmenter
public void setTextFragmenter(Fragmenter fragmenter)(Code)

Parameters:
  fragmenter -



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.