File: SearchEngineInterface.cpp

package info (click to toggle)
pinot 0.95-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 6,860 kB
  • ctags: 4,511
  • sloc: cpp: 39,387; sh: 9,973; ansic: 4,174; makefile: 657; xml: 372; python: 260
file content (87 lines) | stat: -rw-r--r-- 2,336 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
 *  Copyright 2005,2006 Fabrice Colin
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#include <iostream>

#include "Document.h"
#include "StringManip.h"
#include "Url.h"
#include "SearchEngineInterface.h"

using std::cout;
using std::endl;

SearchEngineInterface::SearchEngineInterface() :
	m_defaultOperator(DEFAULT_OP_AND),
	m_resultsCountEstimate(0)
{
}

SearchEngineInterface::~SearchEngineInterface()
{
}

/// Sets whether AND is the default operator.
void SearchEngineInterface::setDefaultOperator(DefaultOperator op)
{
	m_defaultOperator = op;
}

/// Sets the set of documents to limit to.
bool SearchEngineInterface::setLimitSet(const set<string> &docsSet)
{
	// Not all engines support this
	return false;
}

/// Sets the set of documents to expand from.
bool SearchEngineInterface::setExpandSet(const set<string> &docsSet)
{
	// Not all engines support this
	return false;
}

/// Returns the results for the previous query.
const vector<DocumentInfo> &SearchEngineInterface::getResults(void) const
{
	return m_resultsList;
}

/// Returns an estimate of the total number of results for the previous query.
unsigned int SearchEngineInterface::getResultsCountEstimate(void) const
{
	return m_resultsCountEstimate;
}

/// Returns the charset for the previous query's results.
string SearchEngineInterface::getResultsCharset(void) const
{
	return m_charset;
}

/// Suggests a spelling correction.
string SearchEngineInterface::getSpellingCorrection(void) const
{
	return m_correctedFreeQuery;
}

/// Returns expand terms from the previous query.
const set<string> &SearchEngineInterface::getExpandTerms(void) const
{
	return m_expandTerms;
}