ddc
BiblExpander.h
Go to the documentation of this file.
1 //-*- Mode: C++ -*-
2 // DDC originally by Alexey Sokirko
3 // Changes and modifications 2013-2015 by Bryan Jurish
4 //
5 // This file is part of DDC.
6 //
7 // DDC is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Lesser General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // DDC is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Lesser General Public License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with DDC. If not, see <http://www.gnu.org/licenses/>.
19 //
20 
21 #ifndef DDC_BIBL_EXPANDER_H
22 #define DDC_BIBL_EXPANDER_H
23 
24 #include "TermExpander.h"
25 
26 //======================================================================
32 public:
34  string m_BxLabel;
35 
37  string m_BxTarget;
38 
40  string m_BxParam;
41 
42 public:
43  //------------------------------------------------------------
45 
46  CBiblExpander(const string& label=string("NoLabel"), const string& target=string("NoTarget"), const string& param=string(""))
47  : m_BxLabel(label), m_BxTarget(target), m_BxParam(param)
48  {};
49 
51  virtual ~CBiblExpander(void) {};
52 
54  virtual void compile(void) {};
56 
57 public:
58  //------------------------------------------------------------
60 
61  virtual string configString(void) const;
63 
65  virtual void expand(const string& src, set<string>& dst);
66 
68  virtual void expand(const set<string>& src, set<string>& dst);
70 };
71 
72 //======================================================================
77 class BxTermWrapper : public CBiblExpander {
78 public:
81 
82 public:
84  BxTermWrapper(const string& label=string("NoLabel"), const string& target=string("NoTarget"), const string& param=string(""));
85  virtual ~BxTermWrapper(void);
86  virtual void compile(void);
87  virtual void expand(const set<string>& src, set<string>& dst);
88 };
89 
90 #endif /* DDC_BIBL_EXPANDER_H */
91 
92 /*--- emacs style variables ---
93  * Local Variables:
94  * mode: C++
95  * c-file-style: "ellemtel"
96  * c-basic-offset: 4
97  * tab-width: 8
98  * indent-tabs-mode: nil
99  * End:
100  */
virtual void compile(void)
set up object based on label, target, and/or parameter strings; default implementation does nothing ...
Definition: BiblExpander.h:54
Abstract API for bibliographic metadata-expansion modules.
Definition: BiblExpander.h:31
Abstract API for bibliographic metadata-expansion modules.
Definition: BiblExpander.h:77
string m_BxLabel
unique label for this expander
Definition: BiblExpander.h:34
virtual void expand(const string &src, set< string > &dst)
Expand a single term term to a set of terms dst ; default just calls expand(const set<string>&...
Definition: BiblExpander.cpp:37
Abstract API for term-expansion modules (e.g. thesauri, morphologies, equivalence maps...
Definition: TermExpander.h:33
string m_BxParam
string parameters (for stringification)
Definition: BiblExpander.h:40
virtual string configString(void) const
String form of this expander. Default is m_BxLabel + " " + m_BxTarget + " " + m_BxParam.
Definition: BiblExpander.cpp:31
virtual ~CBiblExpander(void)
Default destructor.
Definition: BiblExpander.h:51
CTermExpander * m_BxTx
underlying CTermExpander
Definition: BiblExpander.h:80
CBiblExpander(const string &label=string("NoLabel"), const string &target=string("NoTarget"), const string &param=string(""))
Definition: BiblExpander.h:46
string m_BxTarget
physically indexed target bibliographic field name
Definition: BiblExpander.h:37