1 |
|
/* ============================================================================ |
2 |
|
* Douglas Thrift's Search Engine License |
3 |
|
* |
4 |
< |
* Copyright (C) 2002, Douglas Thrift. All Rights Reserved. |
4 |
> |
* Copyright (C) 2002-2004, Douglas Thrift. All Rights Reserved. |
5 |
|
* Redistribution and use in source and binary forms, with or without |
6 |
|
* modification, are permitted provided that the following conditions are met: |
7 |
|
* |
46 |
|
// |
47 |
|
// Douglas Thrift |
48 |
|
// |
49 |
< |
// Ranker.h |
49 |
> |
// $Id$ |
50 |
|
|
51 |
< |
#ifndef _Ranker_h_ |
52 |
< |
#define _Ranker_h_ |
51 |
> |
#ifndef _Ranker_hpp_ |
52 |
> |
#define _Ranker_hpp_ |
53 |
|
|
54 |
< |
#include "Search.h" |
55 |
< |
#include "Page.h" |
54 |
> |
#include "Search.hpp" |
55 |
> |
#include "Page.hpp" |
56 |
|
|
57 |
|
class Ranker : public Page |
58 |
|
{ |
79 |
|
void checkRequired(); |
80 |
|
void checkExcluded(); |
81 |
|
void checkEitherOr(); |
82 |
< |
unsigned find(string& word, string& where); |
83 |
< |
unsigned find(string& word, string& where, map<unsigned, unsigned>& |
82 |
> |
unsigned find(string word, const string& where); |
83 |
> |
unsigned find(string word, const string& where, map<unsigned, unsigned>& |
84 |
|
occurrences); |
85 |
< |
unsigned phrase(string& phrase, string& where); |
86 |
< |
unsigned phrase(string& phrase, string& where, map<unsigned, unsigned>& |
85 |
> |
unsigned phrase(const string& phrase, const string& where); |
86 |
> |
unsigned phrase(const string& phrase, const string& where, map<unsigned, |
87 |
> |
unsigned>& occurrences); |
88 |
> |
unsigned phrase(const vector<string>& words, unsigned word, unsigned& |
89 |
> |
begin, bool start, const string& where); |
90 |
> |
unsigned phrase(const vector<string>& words, unsigned word, unsigned& |
91 |
> |
begin, bool start, const string& where, map<unsigned, unsigned>& |
92 |
|
occurrences); |
88 |
– |
unsigned phrase(vector<string>& words, unsigned word, unsigned& begin, bool |
89 |
– |
start, string& where); |
90 |
– |
unsigned phrase(vector<string>& words, unsigned word, unsigned& begin, bool |
91 |
– |
start, string& where, map<unsigned, unsigned>& occurrences); |
93 |
|
unsigned evaluate(vector<unsigned>& ins); |
94 |
|
void decrap(string& crap); |
95 |
|
public: |