diff options
Diffstat (limited to 'src/kchmsearchengine_impl.h')
-rw-r--r-- | src/kchmsearchengine_impl.h | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/src/kchmsearchengine_impl.h b/src/kchmsearchengine_impl.h index b8a9fe6..fb317fc 100644 --- a/src/kchmsearchengine_impl.h +++ b/src/kchmsearchengine_impl.h @@ -20,13 +20,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef QASSISTANTINDEX_H -#define QASSISTANTINDEX_H +#ifndef TQASSISTANTINDEX_H +#define TQASSISTANTINDEX_H -#include <qstringlist.h> -#include <qdict.h> -#include <qdatastream.h> -#include <qobject.h> +#include <tqstringlist.h> +#include <tqdict.h> +#include <tqdatastream.h> +#include <tqobject.h> namespace QtAs { @@ -55,43 +55,44 @@ struct Document return frequency < doc.frequency; } - Q_INT16 docNumber; - Q_INT16 frequency; + TQ_INT16 docNumber; + TQ_INT16 frequency; }; -QDataStream &operator>>( QDataStream &s, Document &l ); -QDataStream &operator<<( QDataStream &s, const Document &l ); +TQDataStream &operator>>( TQDataStream &s, Document &l ); +TQDataStream &operator<<( TQDataStream &s, const Document &l ); -class Index : public QObject +class Index : public TQObject { Q_OBJECT + TQ_OBJECT public: struct Entry { Entry( int d ) { documents.append( Document( d, 1 ) ); } - Entry( QValueList<Document> l ) : documents( l ) {} - QValueList<Document> documents; + Entry( TQValueList<Document> l ) : documents( l ) {} + TQValueList<Document> documents; }; struct PosEntry { PosEntry( int p ) { positions.append( p ); } - QValueList<uint> positions; + TQValueList<uint> positions; }; - Index( const QString &dp, const QString &hp ); - Index( const QStringList &dl, const QString &hp ); + Index( const TQString &dp, const TQString &hp ); + Index( const TQStringList &dl, const TQString &hp ); void writeDict(); bool readDict(); bool makeIndex(); - QStringList query( const QStringList&, const QStringList&, const QStringList& ); + TQStringList query( const TQStringList&, const TQStringList&, const TQStringList& ); - void setDictionaryFile( const QString& ); - void setDocListFile( const QString& ); - void setDocList( const QStringList & ); - QString getCharsSplit() const { return m_charssplit; } - QString getCharsPartOfWord() const { return m_charsword; } + void setDictionaryFile( const TQString& ); + void setDocListFile( const TQString& ); + void setDocList( const TQStringList & ); + TQString getCharsSplit() const { return m_charssplit; } + TQString getCharsPartOfWord() const { return m_charsword; } signals: void indexingProgress( int ); @@ -101,51 +102,51 @@ class Index : public QObject private: void setupDocumentList(); - bool parseDocumentToStringlist( const QString& filename, QStringList& tokenlist ); - void parseDocument( const QString& filename, int docnum ); - void insertInDict( const QString&, int ); + bool parseDocumentToStringlist( const TQString& filename, TQStringList& tokenlist ); + void parseDocument( const TQString& filename, int docnum ); + void insertInDict( const TQString&, int ); void writeDocumentList(); bool readDocumentList(); - QStringList getWildcardTerms( const QString& ); - QStringList split( const QString& ); - QValueList<Document> setupDummyTerm( const QStringList& ); - bool searchForPhrases( const QStringList &phrases, const QStringList &words, const QString &filename ); + TQStringList getWildcardTerms( const TQString& ); + TQStringList split( const TQString& ); + TQValueList<Document> setupDummyTerm( const TQStringList& ); + bool searchForPhrases( const TQStringList &phrases, const TQStringList &words, const TQString &filename ); - QStringList docList; - QDict<Entry> dict; - QDict<PosEntry> miniDict; - QString docPath; - QString dictFile; - QString docListFile; + TQStringList docList; + TQDict<Entry> dict; + TQDict<PosEntry> miniDict; + TQString docPath; + TQString dictFile; + TQString docListFile; bool lastWindowClosed; // Those characters are splitters (i.e. split the word), but added themselves into dictionary too. // This makes the dictionary MUCH larger, but ensure that for the piece of "window->print" both // search for "print" and "->print" will find it. - QString m_charssplit; + TQString m_charssplit; // Those characters are parts of word - for example, '_' is here, and search for _debug will find only _debug. - QString m_charsword; + TQString m_charsword; }; struct Term { - Term( const QString &t, int f, QValueList<Document> l ) : term( t ), frequency( f ), documents( l ) {} + Term( const TQString &t, int f, TQValueList<Document> l ) : term( t ), frequency( f ), documents( l ) {} - QString term; + TQString term; int frequency; - QValueList<Document> documents; + TQValueList<Document> documents; }; -class TermList : public QPtrList<Term> +class TermList : public TQPtrList<Term> { public: - TermList() : QPtrList<Term>() {} - int compareItems( QPtrCollection::Item i1, QPtrCollection::Item i2 ); + TermList() : TQPtrList<Term>() {} + int compareItems( TQPtrCollection::Item i1, TQPtrCollection::Item i2 ); }; }; -#endif /* QASSISTANTINDEX_H */ +#endif /* TQASSISTANTINDEX_H */ |