AddCandidate

This method adds a new candidate to the field based on the specified Word ID.

Syntax

AddCandidate (WordNr as Long, WordCount as Long, FilterID as Long, pIndex as Long)
Parameter Description
WordNr Specifies the Word index within the Word array of the workdoc.

Possible values

0 to pWorkdoc.WordCount - 1

WordCount Specifies the number of Words to use for the candidate. If WordCount is greater than 1 the second word for the candidate is defined with WordNr + 1, the third with WordNr + 2.
FilterID This parameter can be used to store a filter identifier inside the candidate. So later it is possible to see which filter expression has created the candidate.
pIndex [out] Returns the index of the new candidate within the candidate array.

Sample Code

Private Sub MyField_PostAnalysis(pField as SCBCdrField, pWorkdoc as SCBCdrWorkdoc)
Dim cindex as long, count as long, id as long
'add a new candidate to the field
if pWorkdoc.Wordcount > 42 then
   'use the 42th word as new candidate
   count = 1   'wordcount of new candidate
   id = 0      'rule-id for later backtracing
   pField.AddCandidate 42, count, id, cindex
   'cindex is the new index of the candidate
end if
End Sub