got rid of STRIPCHARS compile-time variable to make the code more readable, and corresponding configure option. + make sure that CONFDIR from environment gets translated to absolute path
This commit is contained in:
@@ -93,17 +93,13 @@ class TextSplitPTR : public TextSplit {
|
||||
// (phrase or near), update positions list.
|
||||
virtual bool takeword(const std::string& term, int pos, int bts, int bte) {
|
||||
string dumb = term;
|
||||
#ifndef RCL_INDEX_STRIPCHARS
|
||||
if (o_index_stripchars) {
|
||||
#endif
|
||||
if (!unacmaybefold(term, dumb, "UTF-8", UNACOP_UNACFOLD)) {
|
||||
LOGINFO(("PlainToRich::takeword: unac failed for [%s]\n",
|
||||
term.c_str()));
|
||||
return true;
|
||||
}
|
||||
#ifndef RCL_INDEX_STRIPCHARS
|
||||
}
|
||||
#endif
|
||||
|
||||
//LOGDEB2(("Input dumbbed term: '%s' %d %d %d\n", dumb.c_str(),
|
||||
// pos, bts, bte));
|
||||
|
||||
@@ -358,11 +358,7 @@ void ResListPager::displayPage(RclConfig *config)
|
||||
map<string, vector<string> > spellings;
|
||||
suggest(uterms, spellings);
|
||||
if (!spellings.empty()) {
|
||||
#ifndef RCL_INDEX_STRIPCHARS
|
||||
if (o_index_stripchars) {
|
||||
#else
|
||||
if (true) {
|
||||
#endif
|
||||
chunk <<
|
||||
trans("<p><i>Alternate spellings (accents suppressed): </i>")
|
||||
<< "<br /><blockquote>";
|
||||
|
||||
@@ -116,21 +116,15 @@ static void sigcleanup(int sig)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#ifndef RCL_INDEX_STRIPCHARS
|
||||
bool o_index_stripchars;
|
||||
#endif
|
||||
|
||||
inline bool has_prefix(const string& trm)
|
||||
{
|
||||
#ifndef RCL_INDEX_STRIPCHARS
|
||||
if (o_index_stripchars) {
|
||||
#endif
|
||||
return trm.size() && 'A' <= trm[0] && trm[0] <= 'Z';
|
||||
#ifndef RCL_INDEX_STRIPCHARS
|
||||
} else {
|
||||
return trm.size() > 0 && trm[0] == ':';
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
@@ -212,7 +206,6 @@ int main(int argc, char **argv)
|
||||
cout << "DB: ndocs " << db->get_doccount() << " lastdocid " <<
|
||||
db->get_lastdocid() << " avglength " << db->get_avlength() << endl;
|
||||
|
||||
#ifndef RCL_INDEX_STRIPCHARS
|
||||
// If we have terms with a leading ':' it's a new style,
|
||||
// unstripped index
|
||||
{
|
||||
@@ -223,7 +216,6 @@ int main(int argc, char **argv)
|
||||
o_index_stripchars = false;
|
||||
cout<<"DB: terms are "<<(o_index_stripchars?"stripped":"raw")<<endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (op_flags & OPT_T) {
|
||||
Xapian::TermIterator term;
|
||||
|
||||
Reference in New Issue
Block a user