<?php

namespace Kylin\WordFilter\Enums;

/**
 * 敏感词严重程度枚举
 */
enum Severity: string
{
    case Low = 'low';
    case Moderate = 'moderate';
    case High = 'high';
    case Severe = 'severe';

    /**
     * 获取严重程度权重（数值越大越严重）
     */
    public function weight(): int
    {
        return match ($this) {
            self::Low => 1,
            self::Moderate => 2,
            self::High => 3,
            self::Severe => 4,
        };
    }

    /**
     * 获取中文标签
     */
    public function label(): string
    {
        return match ($this) {
            self::Low => '低',
            self::Moderate => '中',
            self::High => '高',
            self::Severe => '严重',
        };
    }
}
