АРЧ АП11 - Добавить item-profitability intent для selected-object follow-up в inventory contour
This commit is contained in:
@@ -41,3 +41,23 @@ export function hasInventorySaleCue(text: string): boolean {
|
||||
value
|
||||
);
|
||||
}
|
||||
|
||||
export function hasInventoryProfitabilityCue(text: string): boolean {
|
||||
const value = toText(text);
|
||||
const hasExplicitEconomicsMetric =
|
||||
/(?:прибыл|марж|рентабел|наценк|выручк|доход|profit(?:ability)?|margin|revenue|unit\s+economics)/iu.test(value);
|
||||
if (hasExplicitEconomicsMetric) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
/(?:заработ(?:ал|али|аем|ок|ан)|прин[её]с(?:ли)?)/iu.test(value) &&
|
||||
/(?:денег|деньг|с\s+продаж[а-яё]*|по\s+продаж[а-яё]*|от\s+продаж[а-яё]*|продаж[а-яё]*|реализац|sale|sales)/iu.test(
|
||||
value
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return /(?:сколько|скока|скок)[\s\S]{0,60}(?:заработ|прин[её]с|денег[\s\S]{0,20}(?:с\s+продаж|по\s+продаж|от\s+продаж|продаж|реализац))/iu.test(
|
||||
value
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user