File: WeightedTerm.h

package info (click to toggle)
lucene%2B%2B 3.0.6-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,340 kB
  • ctags: 21,727
  • sloc: cpp: 125,548; ansic: 26,939; makefile: 19
file content (43 lines) | stat: -rw-r--r-- 1,139 bytes parent folder | download | duplicates (8)
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
/////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
// Distributable under the terms of either the Apache License (Version 2.0)
// or the GNU Lesser General Public License.
/////////////////////////////////////////////////////////////////////////////

#ifndef WEIGHTEDTERM_H
#define WEIGHTEDTERM_H

#include "LuceneContrib.h"
#include "LuceneObject.h"

namespace Lucene {

/// Lightweight class to hold term and a weight value used for scoring this term
class LPPCONTRIBAPI WeightedTerm : public LuceneObject {
public:
    WeightedTerm(double weight, const String& term);
    virtual ~WeightedTerm();

    LUCENE_CLASS(WeightedTerm);

public:
    double weight; // multiplier
    String term; // stemmed form

public:
    /// @return the term value (stemmed)
    String getTerm();

    /// @return the weight associated with this term
    double getWeight();

    /// @param term the term value (stemmed)
    void setTerm(const String& term);

    /// @param weight the weight associated with this term
    void setWeight(double weight);
};

}

#endif