central config part 2
This commit is contained in:
@@ -1,65 +1,142 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
class SalesIntentConfig
|
||||
{
|
||||
|
||||
// Minimum gap between Top 1 and Top 2 so that an intent is truly dominant.
|
||||
public const DOMINANCE_DELTA = 2;
|
||||
|
||||
// Minimum score required for any non-discovery intent to be accepted.
|
||||
public const MIN_SCORE_THRESHOLD = 3;
|
||||
|
||||
private const SALES_SIGNALS = [
|
||||
'preis',
|
||||
'preise',
|
||||
'kosten',
|
||||
'lizenz',
|
||||
'lizenzmodell',
|
||||
'tarif',
|
||||
'tarife',
|
||||
'gebuehr',
|
||||
'gebühr',
|
||||
'monatlich',
|
||||
'jaehrlich',
|
||||
'jährlich',
|
||||
'abo',
|
||||
'subscription',
|
||||
];
|
||||
|
||||
private const COMPARISON_SIGNALS = [
|
||||
'/\bvergleich(en)?\b/u',
|
||||
'/\bvs\b/u',
|
||||
'/\bgegenueber\b/u',
|
||||
'/\balternative(n)?\b/u',
|
||||
'/\bunterschied(e)?\b/u',
|
||||
'/\bbesser\b/u',
|
||||
];
|
||||
|
||||
private const OBJECTION_SIGNALS = [
|
||||
'problem',
|
||||
'risiko',
|
||||
'nachteil',
|
||||
'datenschutz',
|
||||
'dsgvo',
|
||||
'sicherheit',
|
||||
'compliance',
|
||||
'kritik',
|
||||
'zweifel',
|
||||
'unsicher',
|
||||
];
|
||||
|
||||
private const IMPLEMENTATION_SIGNALS = [
|
||||
'implementierung',
|
||||
'implementieren',
|
||||
'integration',
|
||||
'integrieren',
|
||||
'einführung',
|
||||
'einfuehrung',
|
||||
'aufwand',
|
||||
'setup',
|
||||
'rollout',
|
||||
'migration',
|
||||
'installation',
|
||||
'api',
|
||||
'schnittstelle',
|
||||
];
|
||||
|
||||
private const ROI_SIGNALS = [
|
||||
'roi',
|
||||
'rentabilitaet',
|
||||
'rentabilität',
|
||||
'business case',
|
||||
'einsparung',
|
||||
'kosten senken',
|
||||
'umsatz steigern',
|
||||
'effizienz steigern',
|
||||
];
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $config
|
||||
*/
|
||||
public function __construct(private readonly array $config = [])
|
||||
{
|
||||
}
|
||||
|
||||
/** @return string[] */
|
||||
public function getSalesSignals(): array
|
||||
{
|
||||
return [
|
||||
'preis', 'preise', 'kosten', 'lizenz', 'lizenzmodell',
|
||||
'tarif', 'tarife', 'gebuehr', 'gebühr',
|
||||
'monatlich', 'jaehrlich', 'jährlich', 'abo', 'subscription'
|
||||
];
|
||||
return $this->stringList('sales_signals', self::SALES_SIGNALS);
|
||||
}
|
||||
|
||||
/** @return string[] */
|
||||
public function getComparisonSignals(): array
|
||||
{
|
||||
return [
|
||||
'/\bvergleich(en)?\b/u',
|
||||
'/\bvs\b/u',
|
||||
'/\bgegenueber\b/u',
|
||||
'/\balternative(n)?\b/u',
|
||||
'/\bunterschied(e)?\b/u',
|
||||
'/\bbesser\b/u'
|
||||
];
|
||||
return $this->stringList('comparison_signals', self::COMPARISON_SIGNALS);
|
||||
}
|
||||
|
||||
/** @return string[] */
|
||||
public function getObjectionSignals(): array
|
||||
{
|
||||
return [
|
||||
'problem', 'risiko', 'nachteil', 'datenschutz',
|
||||
'dsgvo', 'sicherheit', 'compliance',
|
||||
'kritik', 'zweifel', 'unsicher'
|
||||
];
|
||||
}
|
||||
public function getImplementationSignals(): array
|
||||
{
|
||||
return [
|
||||
'implementierung', 'implementieren',
|
||||
'integration', 'integrieren',
|
||||
'einführung', 'einfuehrung',
|
||||
'aufwand', 'setup', 'rollout',
|
||||
'migration', 'installation',
|
||||
'api', 'schnittstelle'
|
||||
];
|
||||
}
|
||||
public function getRoiSignals(): array
|
||||
{
|
||||
return [
|
||||
'roi', 'rentabilitaet', 'rentabilität',
|
||||
'business case', 'einsparung',
|
||||
'kosten senken', 'umsatz steigern',
|
||||
'effizienz steigern'
|
||||
];
|
||||
return $this->stringList('objection_signals', self::OBJECTION_SIGNALS);
|
||||
}
|
||||
|
||||
}
|
||||
/** @return string[] */
|
||||
public function getImplementationSignals(): array
|
||||
{
|
||||
return $this->stringList('implementation_signals', self::IMPLEMENTATION_SIGNALS);
|
||||
}
|
||||
|
||||
/** @return string[] */
|
||||
public function getRoiSignals(): array
|
||||
{
|
||||
return $this->stringList('roi_signals', self::ROI_SIGNALS);
|
||||
}
|
||||
|
||||
/** @return string[] */
|
||||
private function stringList(string $key, array $default): array
|
||||
{
|
||||
$value = $this->config[$key] ?? $default;
|
||||
if (!is_array($value)) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
$out = [];
|
||||
foreach ($value as $item) {
|
||||
if (!is_scalar($item)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$item = trim((string) $item);
|
||||
if ($item === '' || in_array($item, $out, true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$out[] = $item;
|
||||
}
|
||||
|
||||
return $out !== [] ? $out : $default;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user