|
From: <ust...@us...> - 2009-04-16 16:46:17
|
Revision: 2992
http://clucene.svn.sourceforge.net/clucene/?rev=2992&view=rev
Author: ustramooner
Date: 2009-04-16 16:46:14 +0000 (Thu, 16 Apr 2009)
Log Message:
-----------
fix tests, fix code for windows
Modified Paths:
--------------
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Encoder.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Formatter.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Fragmenter.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/HighlightScorer.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Highlighter.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.cpp
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryTermExtractor.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Scorer.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleFragmenter.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleHTMLEncoder.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleHTMLFormatter.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TextFragment.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenGroup.cpp
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenGroup.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.cpp
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.h
branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/WeightedTerm.h
branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballAnalyzer.h
branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipcompressstream.h
branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipinputstream.cpp
branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipinputstream.h
branches/lucene2_3_2/src/contribs-lib/CMakeLists.txt
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Encoder.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Encoder.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Encoder.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -23,7 +23,7 @@
* Encodes original text. The Encoder works with the Formatter to generate the output.
*
*/
-class Encoder:LUCENE_BASE
+class CLUCENE_CONTRIBS_EXPORT Encoder:LUCENE_BASE
{
public:
/** Virtual destructor */
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Formatter.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Formatter.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Formatter.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -25,7 +25,7 @@
* of mark-up to highlight terms in HTML search results pages.
*
*/
-class Formatter:LUCENE_BASE
+class CLUCENE_CONTRIBS_EXPORT Formatter:LUCENE_BASE
{
public:
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Fragmenter.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Fragmenter.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Fragmenter.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -27,7 +27,7 @@
* by the {@link Highlighter} class. A sophisticated implementation may do this on the basis
* of detecting end of sentences in the text.
*/
-class Fragmenter:LUCENE_BASE
+class CLUCENE_CONTRIBS_EXPORT Fragmenter:LUCENE_BASE
{
public:
/** Virtual destructor */
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/HighlightScorer.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/HighlightScorer.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/HighlightScorer.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -27,7 +27,7 @@
/**
* Adds to the score for a fragment based on its tokens
*/
-class HighlightScorer:LUCENE_BASE
+class CLUCENE_CONTRIBS_EXPORT HighlightScorer:LUCENE_BASE
{
public:
virtual ~HighlightScorer(){
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Highlighter.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Highlighter.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Highlighter.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -41,7 +41,7 @@
* and tokenizers.
* {@link Encoder} and tokenizers.
*/
-class Highlighter :LUCENE_BASE
+class CLUCENE_CONTRIBS_EXPORT Highlighter :LUCENE_BASE
{
private:
int32_t maxDocBytesToAnalyze;
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.cpp
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.cpp 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.cpp 2009-04-16 16:46:14 UTC (rev 2992)
@@ -82,7 +82,7 @@
float_t QueryScorer::getTokenScore(Token * token)
{
- const TCHAR* termText=token->termText();
+ const TCHAR* termText=token->termBuffer();
const WeightedTerm* queryTerm = _termsToFind.get(termText);
if(queryTerm==NULL)
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryScorer.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -39,7 +39,7 @@
*/
//TODO: provide option to boost score of fragments near beginning of document
// based on fragment.getFragNum()
-class QueryScorer : public HighlightScorer
+class CLUCENE_CONTRIBS_EXPORT QueryScorer : public HighlightScorer
{
private:
TextFragment * _currentTextFragment;
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryTermExtractor.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryTermExtractor.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/QueryTermExtractor.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -34,7 +34,7 @@
* expanded terms.
*
*/
-class QueryTermExtractor
+class CLUCENE_CONTRIBS_EXPORT QueryTermExtractor
{
QueryTermExtractor(){
}
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Scorer.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Scorer.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/Scorer.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -28,10 +28,10 @@
class TextFragment;
-class Scorer
+class CLUCENE_CONTRIBS_EXPORT Scorer
{
public:
- virtual ~Scorer() = 0;
+ virtual ~Scorer(){};
/**
* called when a new fragment is started for consideration
* @param newFragment
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleFragmenter.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleFragmenter.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleFragmenter.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -27,7 +27,7 @@
* fragments with no concerns over spotting sentence boundaries.
*/
-class SimpleFragmenter:public Fragmenter
+class CLUCENE_CONTRIBS_EXPORT SimpleFragmenter:public Fragmenter
{
private:
LUCENE_STATIC_CONSTANT(int32_t, DEFAULT_FRAGMENT_SIZE =100 );
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleHTMLEncoder.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleHTMLEncoder.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleHTMLEncoder.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -26,7 +26,7 @@
* Simple {@link Encoder} implementation to escape text for HTML output
*
*/
-class SimpleHTMLEncoder:public Encoder
+class CLUCENE_CONTRIBS_EXPORT SimpleHTMLEncoder:public Encoder
{
public:
SimpleHTMLEncoder(void);
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleHTMLFormatter.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleHTMLFormatter.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/SimpleHTMLFormatter.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -26,7 +26,7 @@
* Simple {@link Formatter} implementation to highlight terms with a pre and post tag
*
*/
-class SimpleHTMLFormatter :public Formatter
+class CLUCENE_CONTRIBS_EXPORT SimpleHTMLFormatter :public Formatter
{
private:
const TCHAR* _preTag;
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TextFragment.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TextFragment.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TextFragment.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -27,7 +27,7 @@
* Low-level class used to record information about a section of a document
* with a score.
*/
-class TextFragment:LUCENE_BASE
+class CLUCENE_CONTRIBS_EXPORT TextFragment:LUCENE_BASE
{
int32_t _fragNum;
int32_t _textStartPos;
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenGroup.cpp
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenGroup.cpp 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenGroup.cpp 2009-04-16 16:46:14 UTC (rev 2992)
@@ -47,7 +47,7 @@
startOffset=cl_min(startOffset,token->startOffset());
endOffset=cl_max(endOffset,token->endOffset());
}
- tokens[numTokens].set(token->termText(),token->startOffset(),token->endOffset(),token->type());;
+ tokens[numTokens].set(token->termBuffer(),token->startOffset(),token->endOffset(),token->type());;
scores[numTokens]=score;
numTokens++;
}
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenGroup.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenGroup.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenGroup.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -26,7 +26,7 @@
* One, or several overlapping tokens, along with the score(s) and the
* scope of the original text
*/
-class TokenGroup: LUCENE_BASE
+class CLUCENE_CONTRIBS_EXPORT TokenGroup: LUCENE_BASE
{
LUCENE_STATIC_CONSTANT(int32_t,MAX_NUM_TOKENS_PER_GROUP=50);
CL_NS(analysis)::Token* tokens;
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.cpp
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.cpp 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.cpp 2009-04-16 16:46:14 UTC (rev 2992)
@@ -98,7 +98,7 @@
} */
//code to reconstruct the original sequence of Tokens
const TCHAR** terms=tpv->getTerms();
- const Array<int32_t>* freq=tpv->getTermFrequencies();
+ const ValueArray<int32_t>* freq=tpv->getTermFrequencies();
size_t totalTokens=0;
for (int32_t i = 0; i < freq->length; i++)
@@ -108,11 +108,11 @@
CLSetList<Token*,TokenOrderCompare>* unsortedTokens = NULL;
for (int32_t t = 0; t < freq->length; t++)
{
- Array<TermVectorOffsetInfo>* offsets=tpv->getOffsets(t);
+ ObjectArray<TermVectorOffsetInfo>* offsets=tpv->getOffsets(t);
if(offsets==NULL)
return NULL;
- Array<int32_t>* pos=NULL;
+ ValueArray<int32_t>* pos=NULL;
if(tokenPositionsGuaranteedContiguous)
{
//try get the token position info to speed up assembly of tokens into sorted sequence
@@ -130,8 +130,8 @@
for (int32_t tp=0; tp < offsets->length; tp++)
{
unsortedTokens->insert(_CLNEW Token(terms[t],
- (*offsets)[tp].getStartOffset(),
- (*offsets)[tp].getEndOffset()));
+ (*offsets)[tp]->getStartOffset(),
+ (*offsets)[tp]->getEndOffset()));
}
}
else
@@ -145,8 +145,8 @@
for (int32_t tp = 0; tp < pos->length; tp++)
{
tokensInOriginalOrder[(*pos)[tp]]=_CLNEW Token(terms[t],
- (*offsets)[tp].getStartOffset(),
- (*offsets)[tp].getEndOffset());
+ (*offsets)[tp]->getStartOffset(),
+ (*offsets)[tp]->getEndOffset());
}
}
}
@@ -192,8 +192,9 @@
//convenience method
TokenStream* TokenSources::getTokenStream(IndexReader* reader,int32_t docId, TCHAR* field,Analyzer* analyzer)
{
- CL_NS(document)::Document* doc=reader->document(docId);
- const TCHAR* contents=doc->get(field);
+ CL_NS(document)::Document doc;
+ reader->document(docId, doc);
+ const TCHAR* contents=doc.get(field);
if(contents==NULL)
{
TCHAR buf[250];
@@ -218,7 +219,7 @@
}
Token* t = tokens[currentToken++];
- token->set(t->termText(),t->startOffset(),t->endOffset(),t->type());;
+ token->set(t->termBuffer(),t->startOffset(),t->endOffset(),t->type());;
return true;
}
void TokenSources::StoredTokenStream::close(){
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/TokenSources.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -16,7 +16,7 @@
CL_NS_DEF2(search,highlight)
-class TokenSources: LUCENE_BASE
+class CLUCENE_CONTRIBS_EXPORT TokenSources: LUCENE_BASE
{
//an object used to iterate across an array of tokens
class StoredTokenStream:public CL_NS(analysis)::TokenStream
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/WeightedTerm.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/WeightedTerm.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/highlighter/WeightedTerm.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -24,7 +24,7 @@
/** Lightweight class to hold term and a weight value used for scoring this term
*/
-class WeightedTerm:LUCENE_BASE
+class CLUCENE_CONTRIBS_EXPORT WeightedTerm:LUCENE_BASE
{
private:
float_t _weight; // multiplier
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballAnalyzer.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballAnalyzer.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/snowball/SnowballAnalyzer.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -13,7 +13,7 @@
* stemmer is the part of the class name before "Stemmer", e.g., the stemmer in
* {@link EnglishStemmer} is named "English".
*/
-class SnowballAnalyzer: public Analyzer {
+class CLUCENE_CONTRIBS_EXPORT SnowballAnalyzer: public Analyzer {
const TCHAR* language;
CLTCSetList* stopSet;
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipcompressstream.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipcompressstream.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipcompressstream.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -26,7 +26,7 @@
CL_NS_DEF(util)
-class GZipCompressInputStream : public InputStream{
+class CLUCENE_CONTRIBS_EXPORT GZipCompressInputStream : public InputStream{
private:
class Internal;
Internal* internal;
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipinputstream.cpp
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipinputstream.cpp 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipinputstream.cpp 2009-04-16 16:46:14 UTC (rev 2992)
@@ -52,7 +52,7 @@
break;
case Z_STREAM_END:
if (zstream->avail_in) {
- input->reset(input->getPosition()-zstream->avail_in);
+ input->reset(input->position()-zstream->avail_in);
}
// we are finished decompressing,
// (but this stream is not yet finished)
@@ -72,7 +72,7 @@
const signed char* begin;
int32_t nread;
- int64_t pos = input->getPosition();
+ int64_t pos = input->position();
nread = input->read(begin, 2, 2);
input->reset(pos);
if (nread != 2) {
Modified: branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipinputstream.h
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipinputstream.h 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CLucene/util/gzipinputstream.h 2009-04-16 16:46:14 UTC (rev 2992)
@@ -13,7 +13,7 @@
CL_NS_DEF(util)
-class GZipInputStream : public CL_NS(util)::BufferedInputStream {
+class CLUCENE_CONTRIBS_EXPORT GZipInputStream : public CL_NS(util)::BufferedInputStream {
public:
enum ZipFormat { ZLIBFORMAT, GZIPFORMAT, ZIPFORMAT};
private:
Modified: branches/lucene2_3_2/src/contribs-lib/CMakeLists.txt
===================================================================
--- branches/lucene2_3_2/src/contribs-lib/CMakeLists.txt 2009-04-16 16:25:40 UTC (rev 2991)
+++ branches/lucene2_3_2/src/contribs-lib/CMakeLists.txt 2009-04-16 16:46:14 UTC (rev 2992)
@@ -73,6 +73,9 @@
)
SET ( clucene_contrib_extras clucene-core clucene-shared )
+#find our headers
+file(GLOB_RECURSE HEADERS ${clucene-contribs-lib_SOURCE_DIR}/*.h)
+
#add extra capabilities
find_package(ZLIB)
IF ( NOT ZLIB_FOUND )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|