p35
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Intent;
|
||||
|
||||
use App\Config\IntentLightConfig;
|
||||
use App\Config\LanguageCleanupConfig;
|
||||
|
||||
/**
|
||||
* IntentLite
|
||||
@@ -20,10 +21,9 @@ final readonly class IntentLite
|
||||
{
|
||||
|
||||
public function __construct(
|
||||
private IntentLightConfig $config
|
||||
)
|
||||
{
|
||||
|
||||
private IntentLightConfig $config,
|
||||
private LanguageCleanupConfig $languageCleanupConfig
|
||||
) {
|
||||
}
|
||||
|
||||
public function detectList(string $originalPrompt): array
|
||||
@@ -99,16 +99,9 @@ final readonly class IntentLite
|
||||
{
|
||||
$s = mb_strtolower($s);
|
||||
|
||||
// Umlaute zusätzlich absichern (falls QueryCleaner das tut)
|
||||
$replacements = [
|
||||
'ä' => 'ae',
|
||||
'ö' => 'oe',
|
||||
'ü' => 'ue',
|
||||
'ß' => 'ss',
|
||||
];
|
||||
|
||||
// Nur als Zusatzform speichern (nicht ersetzen!)
|
||||
foreach ($replacements as $umlaut => $alt) {
|
||||
// Keep the language-specific transliteration table in YAML.
|
||||
// Only append an ASCII variant; do not replace the original form.
|
||||
foreach ($this->languageCleanupConfig->getAsciiTransliterationMap() as $umlaut => $alt) {
|
||||
if (str_contains($s, $umlaut)) {
|
||||
$s .= ' ' . str_replace($umlaut, $alt, $s);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user