3.1.5.2.15 GetPositionSpecialWeight
This algorithm specifies the retrieval of special weight based on the source index.
-
COMMENT GetPositionSpecialWeight COMMENT COMMENT On Entry: Position - Position to calculate weight for COMMENT COMMENT On Exit: Weight - Resulting weight COMMENT PROCEDURE GetPositionSpecialWeight(IN Position : 32 bit integer, OUT Weight : 16 bit integer) // Add some bits (0x8003) to adjust the weight and because // some bits are expected. Since setting 0x3 is required, rotate the source // index 2 bits so as to not lose the precision. // Note that if SourceIndex is larger than 0x1FFF, then some bits // will be lost on the conversion to 16 bits. Presumably if a string // is over 8191 characters long, they will differ well before this // point, so the lost information is irrelevant. SET Weight to (SourceIndex << 2) | 0x8003 RETURN Weight