Open topic with navigation

# getContribution

Returns a specified scoring contribution.

The final score for a match (as retrieved through the getScore method) can be the product of multiple scoring contributions. For some entities the score is then normalized (for example so that it is always a value between 0 and 1).

## Syntax

`edkmatch:getContribution(index)`

## Arguments

Argument | Description
--- | ---
`index` | The number of the contribution to get (where the first contribution has the index zero).

## Returns

The scoring contribution.

## Example

The following example demonstrates how to obtain scoring contributions:

    function processmatch(edkmatch)
        local contributionsCount = edkmatch:getContributionsCount()
        print ("Contributions count: ", contributionsCount)
        if contributionsCount >= 1 then
            for i=0, contributionsCount-1, 1 do
                local contribution = edkmatch:getContribution(i)
                print ("Contribution " .. i .. ": " , contribution)
            end
        end
        print ("Score: " , edkmatch:getScore())
        return true
    end

This script produces output similar to:

    Contributions count:    4.0
    Contribution 0:         1.0
    Contribution 1:         0.75
    Contribution 2:         1.0
    Contribution 3:         0.6
    Score:  0.45

© Copyright 2013-2019 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm