Commit 2fbdd54d authored by Dimitri van Heesch's avatar Dimitri van Heesch

Release-1.3.8-20040913

parent 4ccd672e
DOXYGEN Version 1.3.8-20040906
DOXYGEN Version 1.3.8-20040913
Please read the installation section of the manual
(http://www.doxygen.org/install.html) for instructions.
--------
Dimitri van Heesch (06 September 2004)
Dimitri van Heesch (13 September 2004)
DOXYGEN Version 1.3.8_20040906
DOXYGEN Version 1.3.8_20040913
Please read INSTALL for compilation instructions.
......@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy,
Dimitri van Heesch (dimitri@stack.nl) (06 September 2004)
Dimitri van Heesch (dimitri@stack.nl) (13 September 2004)
1.3.8-20040906
1.3.8-20040913
......@@ -39,6 +39,8 @@ only exception).
<li><tt>\<DD\></tt> Starts an item description.
<li><tt>\<DFN\></tt> Starts a piece of text displayed in a typewriter font.
<li><tt>\</DFN\></tt> Ends a <tt>\<DFN\></tt> section.
<li><tt>\<DIV></tt> Starts a section with a specific style (HTML only)
<li><tt>\</DIV></tt> Ends a section with a specific style (HTML only)
<li><tt>\<DL\></tt> Starts a description list.
<li><tt>\</DL\></tt> Ends a description list.
<li><tt>\<DT\></tt> Starts an item title.
......@@ -71,6 +73,8 @@ only exception).
<li><tt>\</PRE\></tt> Ends a preformatted fragment.
<li><tt>\<SMALL\></tt> Starts a section of text displayed in a smaller font.
<li><tt>\</SMALL\></tt> Ends a <tt>\<SMALL\></tt> section.
<li><tt>\<SPAN></tt> Starts an inline text fragment with a specific style (HTML only)
<li><tt>\</SPAN></tt> Ends an inline text fragment with a specific style (HTML only)
<li><tt>\<STRONG\></tt> Starts a section of bold text.
<li><tt>\</STRONG\></tt> Ends a section of bold text.
<li><tt>\<SUB\></tt> Starts a piece of text displayed in subscript.
......
......@@ -23,7 +23,7 @@ text fragments, generated by doxygen, can be produced in languages other
than English (the default). The output language is chosen through the
configuration file (with default name and known as Doxyfile).
Currently (version 1.3.8-20040825), 30 languages
Currently (version 1.3.8-20040907), 30 languages
are supported (sorted alphabetically):
Afrikaans, Brazilian Portuguese, Catalan, Chinese, Chinese
Traditional, Croatian, Czech, Danish, Dutch, English, Finnish, French,
......@@ -102,7 +102,7 @@ when the translator was updated.
<td>Dutch</td>
<td>Dimitri van Heesch</td>
<td>dimitri at stack dot nl</td>
<td>1.3.9</td>
<td>up-to-date</td>
</tr>
<tr bgcolor="#ffffff">
<td>English</td>
......@@ -275,7 +275,7 @@ when the translator was updated.
\hline
Danish & Erik S\o{}e S\o{}rensen & {\tt\tiny eriksoe+doxygen@daimi.au.dk} & 1.3.9 \\
\hline
Dutch & Dimitri van Heesch & {\tt\tiny dimitri@stack.nl} & 1.3.9 \\
Dutch & Dimitri van Heesch & {\tt\tiny dimitri@stack.nl} & up-to-date \\
\hline
English & Dimitri van Heesch & {\tt\tiny dimitri@stack.nl} & up-to-date \\
\hline
......
(1.3.8-20040825)
(1.3.8-20040907)
Doxygen supports the following 30 languages (sorted alphabetically):
......@@ -8,7 +8,7 @@ German, Greek, Hungarian, Italian, Japanese (+En), Korean (+En),
Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian,
Slovak, Slovene, Spanish, Swedish, and Ukrainian.
Of them, 1 translators are up-to-date, 29 translators are based on
Of them, 2 translators are up-to-date, 28 translators are based on
some adapter class, and 2 are English based.
----------------------------------------------------------------------
......@@ -17,6 +17,7 @@ alphabetically). This means that they derive from the Translator class
and they implement all 201 of the required methods. Anyway, there
still may be some details listed even for them:
TranslatorDutch
TranslatorEnglish
----------------------------------------------------------------------
......@@ -32,7 +33,6 @@ must be implemented to become up-to-date:
TranslatorItalian 1.3.9 6 methods to implement
TranslatorHungarian 1.3.9 6 methods to implement
TranslatorGerman 1.3.9 6 methods to implement
TranslatorDutch 1.3.9 6 methods to implement
TranslatorDanish 1.3.9 6 methods to implement
TranslatorCzech 1.3.9 6 methods to implement
TranslatorCroatian 1.3.9 6 methods to implement
......@@ -205,21 +205,6 @@ TranslatorDanish (TranslatorAdapter_1_3_9) 6 methods to implement
virtual QCString trDir(bool first_capital, bool singular)
TranslatorDutch (TranslatorAdapter_1_3_9) 6 methods to implement
---------------
Implements 195 of the required methods.
Missing methods (should be implemented):
virtual QCString trDirIndex()
virtual QCString trDirDocumentation()
virtual QCString trDirectories()
virtual QCString trDirDescription()
virtual QCString trDirReference(const char * dirName)
virtual QCString trDir(bool first_capital, bool singular)
TranslatorFinnish (TranslatorEnglish) 98 methods to implement
-----------------
......
Summary: A documentation system for C/C++.
Name: doxygen
Version: 1.3.8_20040906
Version: 1.3.8_20040913
Release: 1
Epoch: 1
Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz
......
......@@ -955,7 +955,7 @@ void ClassDef::writeDocumentation(OutputList &ol)
if (Config_getBool("SEARCHENGINE"))
{
Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase());
Doxygen::searchIndex->addWord(localName());
Doxygen::searchIndex->addWord(localName(),TRUE);
}
ol.startTextBlock();
......
......@@ -388,7 +388,7 @@ static void addToSearchIndex(const char *text)
static bool searchEngineEnabled=Config_getBool("SEARCHENGINE");
if (searchEngineEnabled)
{
Doxygen::searchIndex->addWord(text);
Doxygen::searchIndex->addWord(text,FALSE);
}
}
......
......@@ -252,7 +252,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'"))
}
<SComment>\n[ \t]*"//!" |
<SComment>\n[ \t]*"//!<"/.*\n |
<SComment>\n[ \t]*"//!"[^<]/.*\n {
<SComment>\n[ \t]*"//!"[^<\n]/.*\n {
replaceComment(1);
g_readLineCtx=YY_START;
BEGIN(ReadLine);
......
......@@ -1001,7 +1001,8 @@ void Config::check()
alias=alias.stripWhiteSpace();
if (alias.find(re)!=0)
{
config_err("Illegal alias format `%s'. Use \"name=value\"\n",alias.data());
config_err("Illegal alias format `%s'. Use \"name=value\"\n",
alias.data());
}
s=aliasList.next();
}
......
......@@ -132,7 +132,7 @@ ID ([a-z_A-Z][a-z_A-Z0-9]*)|(@[0-9]+)
}
name.resize(0);
}
<Start>":" { // Objective-C argument separator
<Start>{B}*":" { // Objective-C argument separator
name+=yytext;
}
<Start>[*&]+ {
......
......@@ -207,6 +207,7 @@ void DirDef::writePathFragment(OutputList &ol)
if (getOuterScope()!=Doxygen::globalScope &&
getOuterScope()->definitionType()==Definition::TypeDir)
{
//printf("getOuterScope %s\n",getOuterScope()->name().data());
((DirDef*)getOuterScope())->writePathFragment(ol);
ol.writeString("&nbsp;/&nbsp;");
}
......@@ -236,6 +237,7 @@ DirDef *DirDef::createNewDir(const char *path)
{
//printf("Adding new dir %s\n",path);
dir = new DirDef(path);
//printf("createNewDir %s short=%s\n",path,dir->shortName().data());
Doxygen::directories.inSort(path,dir);
}
return dir;
......@@ -267,7 +269,7 @@ DirDef *DirDef::mergeDirectoryInTree(const QCString &path)
while ((i=path.find('/',p))!=-1)
{
QCString part=path.left(i+1);
if (!matchPath(part,Config_getList("STRIP_FROM_PATH")))
if (!matchPath(part,Config_getList("STRIP_FROM_PATH")) && part!="/")
{
dir=createNewDir(part);
}
......@@ -316,13 +318,16 @@ void buildDirectories()
//printf("New dir %s\n",dir->displayName().data());
QCString name = dir->name();
int i=name.findRev('/',name.length()-2);
if (i!=-1)
if (i>0)
{
DirDef *parent = Doxygen::directories.find(name.left(i+1));
//if (parent==0) parent=root;
if (parent) parent->addSubDir(dir);
//printf("DirDef::addSubdir(): Adding subdir\n%s to\n%s\n",
// dir->displayName().data(), parent->displayName().data());
if (parent)
{
parent->addSubDir(dir);
//printf("DirDef::addSubdir(): Adding subdir\n%s to\n%s\n",
// dir->displayName().data(), parent->displayName().data());
}
}
}
}
......
......@@ -1247,7 +1247,7 @@ DocWord::DocWord(DocNode *parent,const QString &word) :
//printf("new word %s url=%s\n",word.data(),g_searchUrl.data());
if (!g_searchUrl.isEmpty())
{
Doxygen::searchIndex->addWord(word);
Doxygen::searchIndex->addWord(word,FALSE);
}
}
......@@ -1262,7 +1262,7 @@ DocLinkedWord::DocLinkedWord(DocNode *parent,const QString &word,
//printf("new word %s url=%s\n",word.data(),g_searchUrl.data());
if (!g_searchUrl.isEmpty())
{
Doxygen::searchIndex->addWord(word);
Doxygen::searchIndex->addWord(word,FALSE);
}
}
......
......@@ -2327,6 +2327,16 @@ bool DotCallGraph::isTrivial() const
//-------------------------------------------------------------
DotDirDeps::DotDirDeps(DirDef *)
{
}
DotDirDeps::~DotDirDeps()
{
}
//-------------------------------------------------------------
void generateGraphLegend(const char *path)
{
QFile dotFile((QCString)path+"/graph_legend.dot");
......
......@@ -31,6 +31,7 @@ class DotNodeList;
class ClassSDict;
class MemberDef;
class Definition;
class DirDef;
enum GraphOutputFormat { BITMAP , EPS };
......@@ -201,6 +202,13 @@ class DotCallGraph
Definition * m_scope;
};
class DotDirDeps
{
public:
DotDirDeps(DirDef *dir);
~DotDirDeps();
};
void generateGraphLegend(const char *path);
void writeDotGraphFromFile(const char *inFile,const char *outDir,
const char *outFile,GraphOutputFormat format);
......
......@@ -1785,10 +1785,16 @@ static bool isVarWithConstructor(Entry *root)
Argument *a;
for (ali.toFirst();(a=ali.current());++ali)
{
//printf("a->name=%s a->type=%s\n",a->name.data(),a->type.data());
if (!a->name.isEmpty() || !a->defval.isEmpty())
{
result=FALSE; // arg has (type,name) pair -> function prototype
if (a->name.find(initChars)==0)
{
result=TRUE;
}
else
{
result=FALSE; // arg has (type,name) pair -> function prototype
}
goto done;
}
if (a->type.isEmpty() || getResolvedClass(ctx,fd,a->type)!=0)
......@@ -2197,8 +2203,8 @@ static void buildFunctionList(Entry *root)
ClassDef *cd=0;
// check if this function's parent is a class
static QRegExp re("([a-z_A-Z0-9: ]*[ *]*[ ]*");
//printf("root->parent=`%s' cd=%p root->type.find(re,0)=%d\n",
// root->parent->name.data(),getClass(root->parent->name),
//printf("root->parent=`%s' %x cd=%p root->type.find(re,0)=%d\n",
// root->parent->name.data(),root->parent->section,getClass(root->parent->name),
// root->type.find(re,0));
QCString scope=stripAnonymousNamespaceScope(root->parent->name);
scope=stripTemplateSpecifiersFromScope(scope,FALSE);
......@@ -2225,6 +2231,7 @@ static void buildFunctionList(Entry *root)
isMember=memIndex<ts || memIndex>te;
}
}
if (root->parent &&
!root->parent->name.isEmpty() &&
(root->parent->section & Entry::COMPOUND_MASK) &&
......@@ -6466,7 +6473,7 @@ static void findDirDocumentation(Entry *root)
SDict<DirDef>::Iterator sdi(Doxygen::directories);
for (sdi.toFirst();(dir=sdi.current());++sdi)
{
printf("Dir: %s<->%s\n",dir->name().data(),normalizedName.data());
//printf("Dir: %s<->%s\n",dir->name().data(),normalizedName.data());
if (dir->name().right(normalizedName.length())==normalizedName)
{
if (matchingDir)
......@@ -6486,7 +6493,7 @@ static void findDirDocumentation(Entry *root)
}
if (matchingDir)
{
printf("Match for with dir %s\n",matchingDir->name().data());
//printf("Match for with dir %s\n",matchingDir->name().data());
matchingDir->setBriefDescription(root->brief,root->briefFile,root->briefLine);
matchingDir->setDocumentation(root->doc,root->docFile,root->docLine);
}
......
......@@ -241,7 +241,7 @@ void FileDef::writeDocumentation(OutputList &ol)
if (Config_getBool("SEARCHENGINE"))
{
Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase());
Doxygen::searchIndex->addWord(localName());
Doxygen::searchIndex->addWord(localName(),TRUE);
}
if (!Config_getString("GENERATE_TAGFILE").isEmpty())
......
......@@ -468,7 +468,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
int i=0,p=0,l=0;
while ((i=we.match(title,p,&l))!=-1) // foreach word in the title
{
Doxygen::searchIndex->addWord(title.mid(i,l));
Doxygen::searchIndex->addWord(title.mid(i,l),TRUE);
p=i+l;
}
}
......
......@@ -201,7 +201,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd,
if (!md->isDefine())
{
QCString key;
if (md->isObjCMethod() && a->attrib.length()>2)
if (md->isObjCMethod() && a->attrib.length()>=2)
{
//printf("Found parameter keyword %s\n",a->attrib.data());
// strip [ and ]
......@@ -845,8 +845,8 @@ void MemberDef::writeDeclaration(OutputList &ol,
if (Config_getBool("SEARCHENGINE"))
{
Doxygen::searchIndex->setCurrentDoc(qualifiedName(),getOutputFileBase(),anchor());
Doxygen::searchIndex->addWord(localName());
Doxygen::searchIndex->addWord(qualifiedName());
Doxygen::searchIndex->addWord(localName(),TRUE);
Doxygen::searchIndex->addWord(qualifiedName(),FALSE);
}
Definition *d=0;
......
......@@ -282,7 +282,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
if (Config_getBool("SEARCHENGINE"))
{
Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase());
Doxygen::searchIndex->addWord(localName());
Doxygen::searchIndex->addWord(localName(),TRUE);
}
if (!Config_getString("GENERATE_TAGFILE").isEmpty())
......
......@@ -1101,10 +1101,17 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
<ObjCReturnType>")" {
BEGIN( ObjCMethod );
}
<ObjCParams>{ID}{BN}*/":" { // Keyword of parameter
lineCount();
QCString keyw = QCString(yytext).stripWhiteSpace();
current->name += keyw;
<ObjCParams>({ID})?":" { // Keyword of parameter
QCString keyw = yytext;
keyw=keyw.left(keyw.length()-1); // strip :
if (keyw.isEmpty())
{
current->name += " :";
}
else
{
current->name += keyw+":";
}
if (current->argList->getLast()->type.isEmpty())
{
current->argList->getLast()->type="id";
......@@ -1121,19 +1128,25 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
current->argList->getLast()->attrib="[,]";
current->argList->getLast()->type="...";
}
/*
<ObjCParams>":" {
current->name += ':';
}
*/
<ObjCParams>"(" {
BEGIN( ObjCParamType );
}
<ObjCParamType>[^)]* {
current->argList->getLast()->type=yytext;
current->argList->getLast()->type=QCString(yytext).stripWhiteSpace();
}
<ObjCParamType>")"{B}* {
<ObjCParamType>")"/{B}* {
BEGIN( ObjCParams );
}
<ObjCMethod,ObjCParams>";" { // end of method declaration
if (current->argList->getLast() && current->argList->getLast()->type.isEmpty())
{
current->argList->getLast()->type="id";
}
current->args = argListToString(current->argList);
//printf("argList=%s\n",current->args.data());
unput(';');
......@@ -1143,6 +1156,11 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
//printf("Type=%s Name=%s args=%s\n",
// current->type.data(),current->name.data(),argListToString(current->argList).data()
// );
if (current->argList->getLast() && current->argList->getLast()->type.isEmpty())
{
current->argList->getLast()->type="id";
}
current->args = argListToString(current->argList);
unput('{');
BEGIN( Function );
}
......@@ -2094,12 +2112,19 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
yyLineNr++;
}
<ReadInitializer>"@\"" {
printf("insideCS=%d\n",insideCS);
current->initializer+=yytext;
if (!insideCS) REJECT;
// C# verbatim string
lastSkipVerbStringContext=YY_START;
pSkipVerbString=&current->initializer;
BEGIN(SkipVerbString);
if (!insideCS && !insideObjC)
{
REJECT;
}
else
{
// C#/ObjC verbatim string
lastSkipVerbStringContext=YY_START;
pSkipVerbString=&current->initializer;
BEGIN(SkipVerbString);
}
}
<SkipVerbString>[^\n"]+ {
*pSkipVerbString+=yytext;
......@@ -3589,7 +3614,10 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
if (insideObjC && *yytext=='(') // class category
{
current->name+='(';
current->section=Entry::CATEGORY_SEC;
if (current->section!=Entry::OBJCIMPL_SEC)
{
current->section=Entry::CATEGORY_SEC;
}
BEGIN( ClassCategory );
}
else
......
<?
function readInt($file)
{
$b1 = ord(fgetc($file)); $b2 = ord(fgetc($file));
......@@ -60,10 +61,15 @@ function search($file,$word,&$statsList)
}
$w = readString($file);
}
$totalFreq=0;
$totalHi=0;
$totalFreqHi=0;
$totalFreqLo=0;
for ($count=$start;$count<sizeof($statsList);$count++)
{
$statInfo = &$statsList[$count];
$multiplier = 1;
// whole word matches have a double weight
if ($statInfo["full"]) $multiplier=2;
fseek($file,$statInfo["index"]);
$numDocs = readInt($file);
$docInfo = array();
......@@ -72,11 +78,22 @@ function search($file,$word,&$statsList)
{
$idx=readInt($file);
$freq=readInt($file);
$docInfo[$i]=array("idx"=>$idx,"freq"=>$freq,"rank"=>0.0);
$totalFreq+=$freq;
if ($statInfo["full"]) $totalFreq+=$freq;
$docInfo[$i]=array("idx" => $idx,
"freq" => $freq>>1,
"rank" => 0.0,
"hi" => $freq&1
);
if ($freq&1) // word occurs in high priority doc
{
$totalHi++;
$totalFreqHi+=$freq*$multiplier;
}
else // word occurs in low priority doc
{
$totalFreqLo+=$freq*$multiplier;
}
}
// read name an url info for the doc
// read name and url info for the doc
for ($i=0;$i<$numDocs;$i++)
{
fseek($file,$docInfo[$i]["idx"]);
......@@ -85,15 +102,28 @@ function search($file,$word,&$statsList)
}
$statInfo["docs"]=$docInfo;
}
$totalFreq=($totalHi+1)*$totalFreqLo + $totalFreqHi;
for ($count=$start;$count<sizeof($statsList);$count++)
{
$statInfo = &$statsList[$count];
$multiplier = 1;
// whole word matches have a double weight
if ($statInfo["full"]) $multiplier=2;
for ($i=0;$i<sizeof($statInfo["docs"]);$i++)
{
$docInfo = &$statInfo["docs"];
// compute frequency rank of the word in each doc
$statInfo["docs"][$i]["rank"]=
(float)$docInfo[$i]["freq"]/$totalFreq;
$freq=$docInfo[$i]["freq"];
if ($docInfo[$i]["hi"])
{
$statInfo["docs"][$i]["rank"]=
(float)($freq*$multiplier+$totalFreqLo)/$totalFreq;
}
else
{
$statInfo["docs"][$i]["rank"]=
(float)($freq*$multiplier)/$totalFreq;
}
}
}
}
......@@ -113,7 +143,6 @@ function combine_results($results,&$docs)
if (in_array($key, array_keys($docs)))
{
$docs[$key]["rank"]+=$rank;
$docs[$key]["rank"]*=2; // multiple matches increases rank
}
else
{
......@@ -132,25 +161,6 @@ function combine_results($results,&$docs)
return $docs;
}
function normalize_ranking(&$docs)
{
$maxRank = 0.0000001;
// compute maximal rank
foreach ($docs as $doc)
{
if ($doc["rank"]>$maxRank)
{
$maxRank=$doc["rank"];
}
}
reset($docs);
// normalize rankings
while (list ($key, $val) = each ($docs))
{
$docs[$key]["rank"]*=100/$maxRank;
}
}
function filter_results($docs,&$requiredWords,&$forbiddenWords)
{
$filteredDocs=array();
......@@ -284,7 +294,7 @@ function main()
if (!in_array($word,$foundWords))
{
$foundWords[]=$word;
search($file,strtolower($word),$results);
search($file,$word,$results);
}
$word=strtok(" ");
}
......@@ -293,8 +303,6 @@ function main()
// filter out documents with forbidden word or that do not contain
// required words
$filteredDocs = filter_results($docs,$requiredWords,$forbiddenWords);
// normalize rankings so they are in the range [0-100]
normalize_ranking($filteredDocs);
// sort the results based on rank
$sorted = array();
sort_results($filteredDocs,$sorted);
......
"<?\n"
"function readInt($file)\n"
"{\n"
" $b1 = ord(fgetc($file)); $b2 = ord(fgetc($file));\n"
......@@ -60,10 +61,15 @@
" }\n"
" $w = readString($file);\n"
" }\n"
" $totalFreq=0;\n"
" $totalHi=0;\n"
" $totalFreqHi=0;\n"
" $totalFreqLo=0;\n"
" for ($count=$start;$count<sizeof($statsList);$count++)\n"
" {\n"
" $statInfo = &$statsList[$count];\n"
" $multiplier = 1;\n"
" // whole word matches have a double weight\n"
" if ($statInfo[\"full\"]) $multiplier=2;\n"
" fseek($file,$statInfo[\"index\"]); \n"
" $numDocs = readInt($file);\n"
" $docInfo = array();\n"
......@@ -72,11 +78,22 @@
" {\n"
" $idx=readInt($file); \n"
" $freq=readInt($file); \n"
" $docInfo[$i]=array(\"idx\"=>$idx,\"freq\"=>$freq,\"rank\"=>0.0);\n"
" $totalFreq+=$freq;\n"
" if ($statInfo[\"full\"]) $totalFreq+=$freq;\n"
" $docInfo[$i]=array(\"idx\" => $idx,\n"
" \"freq\" => $freq>>1,\n"
" \"rank\" => 0.0,\n"
" \"hi\" => $freq&1\n"
" );\n"
" if ($freq&1) // word occurs in high priority doc\n"
" {\n"
" $totalHi++;\n"
" $totalFreqHi+=$freq*$multiplier;\n"
" }\n"
" else // word occurs in low priority doc\n"
" {\n"
" $totalFreqLo+=$freq*$multiplier;\n"
" }\n"
" }\n"
" // read name an url info for the doc\n"
" // read name and url info for the doc\n"
" for ($i=0;$i<$numDocs;$i++)\n"
" {\n"
" fseek($file,$docInfo[$i][\"idx\"]);\n"
......@@ -85,15 +102,28 @@
" }\n"
" $statInfo[\"docs\"]=$docInfo;\n"
" }\n"
" $totalFreq=($totalHi+1)*$totalFreqLo + $totalFreqHi;\n"
" for ($count=$start;$count<sizeof($statsList);$count++)\n"
" {\n"
" $statInfo = &$statsList[$count];\n"
" $multiplier = 1;\n"
" // whole word matches have a double weight\n"
" if ($statInfo[\"full\"]) $multiplier=2;\n"
" for ($i=0;$i<sizeof($statInfo[\"docs\"]);$i++)\n"
" {\n"
" $docInfo = &$statInfo[\"docs\"];\n"
" // compute frequency rank of the word in each doc\n"
" $statInfo[\"docs\"][$i][\"rank\"]=\n"
" (float)$docInfo[$i][\"freq\"]/$totalFreq;\n"
" $freq=$docInfo[$i][\"freq\"];\n"
" if ($docInfo[$i][\"hi\"])\n"
" {\n"
" $statInfo[\"docs\"][$i][\"rank\"]=\n"
" (float)($freq*$multiplier+$totalFreqLo)/$totalFreq;\n"
" }\n"
" else\n"
" {\n"
" $statInfo[\"docs\"][$i][\"rank\"]=\n"
" (float)($freq*$multiplier)/$totalFreq;\n"
" }\n"
" }\n"
" }\n"
" }\n"
......@@ -113,7 +143,6 @@
" if (in_array($key, array_keys($docs)))\n"
" {\n"
" $docs[$key][\"rank\"]+=$rank;\n"
" $docs[$key][\"rank\"]*=2; // multiple matches increases rank \n"
" }\n"
" else\n"
" {\n"
......@@ -132,25 +161,6 @@
" return $docs;\n"
"}\n"
"\n"
"function normalize_ranking(&$docs)\n"
"{\n"
" $maxRank = 0.0000001;\n"
" // compute maximal rank\n"
" foreach ($docs as $doc) \n"
" {\n"
" if ($doc[\"rank\"]>$maxRank)\n"
" {\n"
" $maxRank=$doc[\"rank\"];\n"
" }\n"
" }\n"
" reset($docs);\n"
" // normalize rankings\n"
" while (list ($key, $val) = each ($docs)) \n"
" {\n"
" $docs[$key][\"rank\"]*=100/$maxRank;\n"
" }\n"
"}\n"
"\n"
"function filter_results($docs,&$requiredWords,&$forbiddenWords)\n"
"{\n"
" $filteredDocs=array();\n"
......@@ -284,7 +294,7 @@
" if (!in_array($word,$foundWords))\n"
" {\n"
" $foundWords[]=$word;\n"
" search($file,strtolower($word),$results);\n"
" search($file,$word,$results);\n"
" }\n"
" $word=strtok(\" \");\n"
" }\n"
......@@ -293,8 +303,6 @@
" // filter out documents with forbidden word or that do not contain\n"
" // required words\n"
" $filteredDocs = filter_results($docs,$requiredWords,$forbiddenWords);\n"
" // normalize rankings so they are in the range [0-100]\n"
" normalize_ranking($filteredDocs);\n"
" // sort the results based on rank\n"
" $sorted = array();\n"
" sort_results($filteredDocs,$sorted);\n"
......
......@@ -21,14 +21,16 @@
#include <qfile.h>
// file format:
// file format: (all multi-byte values are stored in big endian format)
// 4 byte header
// 256*256*4 byte index
// 256*256*4 byte index (4 bytes)
// for each index entry: a zero terminated list of words
// for each word: a 0 terminated string + 4 bytes stats index
// for each word: a \0 terminated string + 4 byte offset to the stats info
// padding bytes to align at 4 byte boundary
// for each word: a counter + for each url containing the word 8 bytes statistics
// for each url: a 0 terminated string
// for each word: the number of urls (4 bytes)
// + for each url containing the word 8 bytes statistics
// (4 bytes index to url string + 4 bytes frequency counter)
// for each url: a \0 terminated string
const int numIndexEntries = 256*256;
......@@ -37,17 +39,21 @@ const int numIndexEntries = 256*256;
IndexWord::IndexWord(const char *word) : m_word(word), m_urls(17)
{
m_urls.setAutoDelete(TRUE);
//printf("IndexWord::IndexWord(%s)\n",word);
}
void IndexWord::addUrlIndex(int idx)
void IndexWord::addUrlIndex(int idx,bool hiPriority)
{
//printf("IndexWord::addUrlIndex(%d,%d)\n",idx,hiPriority);
URLInfo *ui = m_urls.find(idx);
if (ui==0)
{
//printf("URLInfo::URLInfo(%d)\n",idx);
ui=new URLInfo(idx,0);
m_urls.insert(idx,ui);
}
ui->freq++;
ui->freq+=2;
if (hiPriority) ui->freq|=1; // mark as high priority document
}
//--------------------------------------------------------------------
......@@ -62,6 +68,7 @@ SearchIndex::SearchIndex() : m_words(328829), m_index(numIndexEntries), m_urlInd
void SearchIndex::setCurrentDoc(const char *name,const char *baseName,const char *anchor)
{
//printf("SearchIndex::setCurrentDoc(%s,%s,%s)\n",name,baseName,anchor);
QCString url=baseName+Config_getString("HTML_FILE_EXTENSION");
if (anchor) url+=(QCString)"#"+anchor;
m_urlIndex++;
......@@ -79,9 +86,11 @@ static int charsToIndex(const char *word)
return c1*256+c2;
}
void SearchIndex::addWord(const char *word)
void SearchIndex::addWord(const char *word,bool hiPriority)
{
QString wStr=QString(word).lower();
//printf("SearchIndex::addWord(%s,%d)\n",word,hiPriority);
//QString wStr=QString(word).lower();
QString wStr(word);
if (wStr.isEmpty()) return;
IndexWord *w = m_words[wStr];
if (w==0)
......@@ -91,9 +100,9 @@ void SearchIndex::addWord(const char *word)
w = new IndexWord(wStr);
//fprintf(stderr,"addWord(%s) at index %d\n",word,idx);
m_index[idx]->append(w);
m_words.insert(word,w);
m_words.insert(wStr,w);
}
w->addUrlIndex(m_urlIndex);
w->addUrlIndex(m_urlIndex,hiPriority);
}
......@@ -257,21 +266,6 @@ void SearchIndex::write(const char *fileName)
}
}
//for (wdi.toFirst();(iw=wdi.current());++wdi)
//{
// printf("Word %s:\n",wdi.currentKey().data());
// QIntDictIterator<URLInfo> udi(iw->urls());
// URLInfo *ui;
// for (udi.toFirst();(ui=udi.current());++udi)
// {
// printf(" url[%d]=(name=%s,url=%s),freq=%d\n",
// ui->urlIdx,
// m_urls[ui->urlIdx]->name.data(),
// m_urls[ui->urlIdx]->url.data(),
// ui->freq);
// }
//}
delete urlOffsets;
delete wordStatOffsets;
}
......
......@@ -44,7 +44,7 @@ class IndexWord
{
public:
IndexWord(const char *word);
void addUrlIndex(int);
void addUrlIndex(int,bool);
const QIntDict<URLInfo> &urls() const { return m_urls; }
QCString word() const { return m_word; }
......@@ -58,7 +58,7 @@ class SearchIndex
public:
SearchIndex();
void setCurrentDoc(const char *name,const char *baseName,const char *anchor=0);
void addWord(const char *word);
void addWord(const char *word,bool hiPriority);
void write(const char *file);
private:
QDict<IndexWord> m_words;
......
......@@ -1560,16 +1560,41 @@ class TranslatorEnglish : public Translator
// new since 1.3.9
//////////////////////////////////////////////////////////////////////////
/*! This is used as the name of the chapter containing the directory
* hierarchy.
*/
virtual QCString trDirIndex()
{ return "Directories"; }
{ return "Directory Hierarchy"; }
/*! This is used as the name of the chapter containing the documentation
* of the directories.
*/
virtual QCString trDirDocumentation()
{ return "Directory Documentation"; }
/*! This is used as the title of the directory index and also in the
* Quick links of a HTML page, to link to the directory hierarchy.
*/
virtual QCString trDirectories()
{ return "Directories"; }
/*! This returns a sentences that introduces the directory hierarchy.
* and the fact that it is sorted alphabetically per level
*/
virtual QCString trDirDescription()
{ return "Here is a list of all directories:"; }
{ return "This directory hierarchy is sorted roughly, "
"but not completely, alphabetically:";
}
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
virtual QCString trDirReference(const char *dirName)
{ QCString result=dirName; result+=" Directory Reference"; return result; }
/*! This returns the word directory with or without starting capital
* (\a first_capital) and in sigular or plural form (\a singular).
*/
virtual QCString trDir(bool first_capital, bool singular)
{
QCString result((first_capital ? "Director" : "director"));
......
......@@ -18,7 +18,7 @@
#ifndef TRANSLATOR_NL_H
#define TRANSLATOR_NL_H
class TranslatorDutch : public TranslatorAdapter_1_3_9
class TranslatorDutch : public Translator
{
public:
QCString idLanguage()
......@@ -1154,6 +1154,52 @@ class TranslatorDutch : public TranslatorAdapter_1_3_9
return filename + " Bron Bestand";
}
//////////////////////////////////////////////////////////////////////////
// new since 1.3.9
//////////////////////////////////////////////////////////////////////////
/*! This is used as the name of the chapter containing the directory
* hierarchy.
*/
virtual QCString trDirIndex()
{ return "Directory Hi&euml;rarchie"; }
/*! This is used as the name of the chapter containing the documentation
* of the directories.
*/
virtual QCString trDirDocumentation()
{ return "Directory Documentatie"; }
/*! This is used as the title of the directory index and also in the
* Quick links of a HTML page, to link to the directory hierarchy.
*/
virtual QCString trDirectories()
{ return "Directories"; }
/*! This returns a sentences that introduces the directory hierarchy.
* and the fact that it is sorted alphabetically per level
*/
virtual QCString trDirDescription()
{ return "Deze directory hi&euml;rarchie is min of meer alfabetisch "
"gesorteerd:";
}
/*! This returns the title of a directory page. The name of the
* directory is passed via \a dirName.
*/
virtual QCString trDirReference(const char *dirName)
{ QCString result=dirName; result+=" Directory Referentie"; return result; }
/*! This returns the word directory with or without starting capital
* (\a first_capital) and in sigular or plural form (\a singular).
*/
virtual QCString trDir(bool first_capital, bool singular)
{
QCString result((first_capital ? "Director" : "director"));
if (singular) result+="y"; else result+="ies";
return result;
}
};
......
......@@ -1678,15 +1678,15 @@ void generateXML()
generateXMLForClass(cd,t);
}
}
{
ClassSDict::Iterator cli(Doxygen::hiddenClasses);
ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli)
{
msg("Generating XML output for class %s\n",cd->name().data());
generateXMLForClass(cd,t);
}
}
//{
// ClassSDict::Iterator cli(Doxygen::hiddenClasses);
// ClassDef *cd;
// for (cli.toFirst();(cd=cli.current());++cli)
// {
// msg("Generating XML output for class %s\n",cd->name().data());
// generateXMLForClass(cd,t);
// }
//}
NamespaceSDict::Iterator nli(Doxygen::namespaceSDict);
NamespaceDef *nd;
for (nli.toFirst();(nd=nli.current());++nli)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment