Evaluates the new shingle token weight. for (shingle part token in shingle) weight += shingle part token weight * (1 / sqrt(all shingle part token weights summed)) This algorithm gives a slightly greater score for longer shingles and is rather penalising to great shingle token part weights.

Namespace: Lucene.Net.Analyzers.Shingle
Assembly: Lucene.Net.Contrib.Analyzers (in Lucene.Net.Contrib.Analyzers.dll) Version: 2.9.2.1 (2.9.2.1)

Syntax

C#
public float CalculateShingleWeight(
	Token shingleToken,
	List<Token> shingle,
	int currentPermutationStartOffset,
	List<Row> currentPermutationRows,
	List<Token> currentPermuationTokens
)
Visual Basic
Public Function CalculateShingleWeight ( _
	shingleToken As Token, _
	shingle As List(Of Token), _
	currentPermutationStartOffset As Integer, _
	currentPermutationRows As List(Of Row), _
	currentPermuationTokens As List(Of Token) _
) As Single
Visual C++
public:
float CalculateShingleWeight(
	Token^ shingleToken, 
	List<Token^>^ shingle, 
	int currentPermutationStartOffset, 
	List<Row^>^ currentPermutationRows, 
	List<Token^>^ currentPermuationTokens
)

Parameters

shingleToken
Type: Lucene.Net.Analysis..::..Token
token returned to consumer
shingle
Type: System.Collections.Generic..::..List<(Of <(<'Token>)>)>
tokens the tokens used to produce the shingle token.
currentPermutationStartOffset
Type: System..::..Int32
start offset in parameter currentPermutationRows and currentPermutationTokens.
currentPermutationRows
Type: System.Collections.Generic..::..List<(Of <(<'Row>)>)>
an index to what matrix row a token in parameter currentPermutationTokens exist.
currentPermuationTokens
Type: System.Collections.Generic..::..List<(Of <(<'Token>)>)>
all tokens in the current row permutation of the matrix. A sub list (parameter offset, parameter shingle.size) equals parameter shingle.

Return Value

weight to be set for parameter shingleToken

See Also