Fix parser: buscar por palabras clave
This commit is contained in:
@@ -728,11 +728,10 @@ for (const linea of lineas) {
|
||||
for (const [clave, info] of Object.entries(mapeoParametros)) {
|
||||
if (lineaLower.includes(clave)) {
|
||||
const cleanLinea = linea.replace(/show_chart|list_alt/g, '').replace(/\t+/g, ' ').replace(/\s+/g, ' ').trim();
|
||||
console.log('Testing param:', clave, 'in:', cleanLinea);
|
||||
const partes = cleanLinea.split(' ');
|
||||
|
||||
const claveParts = clave.split(' ');
|
||||
let idxParam = partes.findIndex(p => claveParts.some(cp => p.toLowerCase().includes(cp)));
|
||||
const keyWords = clave.split(' ').filter(w => w.length > 2);
|
||||
let idxParam = partes.findIndex(p => keyWords.some(kw => p.toLowerCase().includes(kw)));
|
||||
if (idxParam === -1) idxParam = 0;
|
||||
|
||||
for (let i = idxParam + 1; i < partes.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user