(components: NonFriendScoreComponents)
| 168 | } |
| 169 | |
| 170 | export function computeNonFriendScore(components: NonFriendScoreComponents): ContactScoringResult { |
| 171 | const coOccurrenceScore = clamp01(components.coOccurrenceScore) |
| 172 | const commonGroupScore = clamp01(components.commonGroupScore) |
| 173 | const replyInteractionScore = clamp01(components.replyInteractionScore) |
| 174 | const score = |
| 175 | NON_FRIEND_SCORE_WEIGHTS.coOccurrence * coOccurrenceScore + |
| 176 | NON_FRIEND_SCORE_WEIGHTS.commonGroup * commonGroupScore + |
| 177 | NON_FRIEND_SCORE_WEIGHTS.replyInteraction * replyInteractionScore |
| 178 | |
| 179 | return { |
| 180 | score, |
| 181 | scoreBreakdown: { |
| 182 | coOccurrenceScore, |
| 183 | commonGroupScore, |
| 184 | replyInteractionScore, |
| 185 | commonGroupCount: components.commonGroupCount, |
| 186 | coOccurrenceCount: components.coOccurrenceCount, |
| 187 | coOccurrenceRawScore: components.coOccurrenceRawScore, |
| 188 | replyInteractionCount: components.replyInteractionCount, |
| 189 | repliesFromOwnerToContact: components.repliesFromOwnerToContact, |
| 190 | repliesFromContactToOwner: components.repliesFromContactToOwner, |
| 191 | }, |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | export function computeNonFriendScores<T extends NonFriendScoreInput>( |
| 196 | items: readonly T[] |
no test coverage detected