diff --git a/src/Knowledge/KeywordMapper.php b/src/Knowledge/KeywordMapper.php deleted file mode 100644 index d2ead79..0000000 --- a/src/Knowledge/KeywordMapper.php +++ /dev/null @@ -1,35 +0,0 @@ - 'künstliche Intelligenz, AI, Projekte, Modelle, Agenten, ki', - 'shop' => 'Shopware, Onlineshop, Webshop, Commerce-System', - 'shops' => 'Shopware, Webshops, Verkaufsplattformen', - 'agentur' => 'Agentur, Firma, Unternehmen, mitho media', - 'api' => 'Schnittstelle, API, Anbindung, Integration', - 'plugin' => 'Shopware Plugin, Erweiterung, Modul, Funktion', - ]; - - /** - * Maps a raw prompt to an expanded semantic variant if applicable. - */ - public function map(string $prompt): string - { - $key = mb_strtolower(trim($prompt)); - - return $this->map[$key] ?? $prompt; - } -} diff --git a/src/Knowledge/KeywordSimilarity.php b/src/Knowledge/KeywordSimilarity.php deleted file mode 100644 index 84a44ba..0000000 --- a/src/Knowledge/KeywordSimilarity.php +++ /dev/null @@ -1,87 +0,0 @@ -= 6 && mb_strlen($b) >= 6) { - $distance = levenshtein($a, $b); - - if ($distance === 1) { - return 0.9; - } - - if ($distance === 2) { - return 0.8; - } - } - - // No relevant match - return 0.0; - } - - /** - * Normalize a keyword to ensure stable comparison. - */ - private static function normalize(string $value): string - { - $value = mb_strtolower(trim($value)); - - // Remove non-alphanumeric characters - $value = preg_replace('/[^\p{L}\p{N}]/u', '', $value) ?? ''; - - // Normalize German umlauts - $map = [ - 'ä' => 'ae', - 'ö' => 'oe', - 'ü' => 'ue', - 'ß' => 'ss', - ]; - - return strtr($value, $map); - } -}