Google\Cloud\Vision\Annotation\LikelihoodTrait::likelihood PHP Method

likelihood() private method

private likelihood ( string $value, string $strength ) : boolean
$value string The value name
$strength string The strength to test with
return boolean
    private function likelihood($value, $strength)
    {
        if (!array_key_exists($strength, $this->likelihoodLevels)) {
            throw new InvalidArgumentException(sprintf('Given strength %s is not a valid value', $strength));
        }
        $levels = $this->likelihoodLevels[$strength];
        if (in_array($value, $levels)) {
            return true;
        }
        return false;
    }
LikelihoodTrait