Calculate the weight field value for the words in the list.
Declaration Syntax
C# | Visual Basic | Visual C++ |
protected virtual void CalculateWordRelevancies( WordCollection wordsList )
Protected Overridable Sub CalculateWordRelevancies ( _ wordsList As WordCollection _ )
protected: virtual void CalculateWordRelevancies( WordCollection^ wordsList )
Parameters
- wordsList (WordCollection)
- ArrayList of Word objects, with inBody, in Title, inURL fields filled
Remarks
This method defines the relationship between the occurrences (hits) in the document
and the weight of the words in the document.
Eg.
A document contains 4 words;
"this", "is", "this", "example".
The document's title is;
"example"
The document's URL is;
http://localhost/example.html
If phrase matching is enabled, when the build is performed the wordsList parameter will contain
Word objects with the following data:
If phrase matching is disabled, when the build is performed the wordsList parameter will contain
Word objects with the following data:
This method is then called to calculate the Weight property in the Word objects (by default it uses the weight coefficients).
This method can therefore be overridden with custom rules for weighting.
CopyC#
wordsList[0] = "this", inUri=0, inTitle=0, inBody=1 wordsList[1] = "is", inUri=0, inTitle=0, inBody=1 wordsList[2] = "this", inUri=0, inTitle=0, inBody=1 wordsList[3] = "example", inUri=1, inTitle=1, inBody=1
CopyC#
wordsList[0] = "this", inUri=0, inTitle=0, inBody=2 wordsList[1] = "is", inUri=0, inTitle=0, inBody=1 wordsList[2] = "example", inUri=1, inTitle=1, inBody=1