|
a/src/rcldb/rcldb.cpp |
|
b/src/rcldb/rcldb.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.140 2008-08-30 07:38:43 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.141 2008-08-30 12:21:41 dockes Exp $ (C) 2004 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
919 |
// Simple file name. This is used for file name searches only. We index
|
919 |
// Simple file name. This is used for file name searches only. We index
|
920 |
// it with a term prefix. utf8fn used to be the full path, but it's now
|
920 |
// it with a term prefix. utf8fn used to be the full path, but it's now
|
921 |
// the simple file name.
|
921 |
// the simple file name.
|
922 |
// We also add a term for the filename extension if any.
|
922 |
// We also add a term for the filename extension if any.
|
923 |
if (dumb_string(doc.utf8fn, noacc) && !noacc.empty()) {
|
923 |
if (dumb_string(doc.utf8fn, noacc) && !noacc.empty()) {
|
924 |
string::size_type pos = noacc.rfind('.');
|
|
|
925 |
// We should truncate after extracting the extension, but this is
|
924 |
// We should truncate after extracting the extension, but this is
|
926 |
// a pathological case anyway
|
925 |
// a pathological case anyway
|
927 |
if (noacc.size() > 230)
|
926 |
if (noacc.size() > 230)
|
928 |
utf8truncate(noacc, 230);
|
927 |
utf8truncate(noacc, 230);
|
|
|
928 |
string::size_type pos = noacc.rfind('.');
|
929 |
if (pos != string::npos && pos != noacc.length() -1) {
|
929 |
if (pos != string::npos && pos != noacc.length() -1) {
|
930 |
newdocument.add_term(string("XE") + noacc.substr(pos+1));
|
930 |
newdocument.add_term(string("XE") + noacc.substr(pos+1));
|
931 |
}
|
931 |
}
|
932 |
noacc = string("XSFN") + noacc;
|
932 |
noacc = string("XSFN") + noacc;
|
933 |
newdocument.add_term(noacc);
|
933 |
newdocument.add_term(noacc);
|