feat(tech-steps): détecte les températures dans les étapes #19
2 changed files with 19 additions and 0 deletions
|
|
@ -285,6 +285,18 @@ describe("tech-step-matcher", () => {
|
|||
contextEnd: text.length,
|
||||
ingredients: [],
|
||||
utensils: [],
|
||||
// "feu doux" [16, 24) is a qualitative-heat mention in this same
|
||||
// clause — see `temperature_extraction.py`.
|
||||
temperatures: [
|
||||
{
|
||||
start: 16,
|
||||
end: 24,
|
||||
celsius: null,
|
||||
gasMark: null,
|
||||
qualitative: "low",
|
||||
raw: "feu doux",
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
expect(text.slice(6, 13).toLowerCase()).to.equal("mijoter");
|
||||
|
|
@ -341,6 +353,7 @@ describe("tech-step-matcher", () => {
|
|||
// (see `IntentServiceEntity.kind`).
|
||||
ingredients: [],
|
||||
utensils: [{ utensilId: panId, start: 9, end: 14 }],
|
||||
temperatures: [],
|
||||
});
|
||||
expect(result[1]).to.deep.equal({
|
||||
techStepId: meltId,
|
||||
|
|
@ -357,6 +370,7 @@ describe("tech-step-matcher", () => {
|
|||
{ ingredientId: butterId, start: 50, end: 56, quantity: null, unitId: null },
|
||||
],
|
||||
utensils: [],
|
||||
temperatures: [],
|
||||
});
|
||||
expect(text.slice(result[0].start, result[0].end)).to.equal("poêle chaude");
|
||||
expect(text.slice(result[0].contextStart, result[0].contextEnd)).to.equal(
|
||||
|
|
@ -387,6 +401,7 @@ describe("tech-step-matcher", () => {
|
|||
{ ingredientId: butterId, start: 18, end: 24, quantity: null, unitId: null },
|
||||
],
|
||||
utensils: [{ utensilId: panId, start: 45, end: 50 }],
|
||||
temperatures: [],
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
|
@ -405,6 +420,7 @@ describe("tech-step-matcher", () => {
|
|||
{ ingredientId: onionId, start: 9, end: 15, quantity: null, unitId: null },
|
||||
],
|
||||
utensils: [],
|
||||
temperatures: [],
|
||||
},
|
||||
]);
|
||||
expect(text.slice(0, 4)).to.equal("Chop");
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ describe("Recipe tech-step corrections", () => {
|
|||
source: "manual",
|
||||
ingredients: [],
|
||||
utensils: [],
|
||||
temperatures: [],
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
|
@ -156,6 +157,7 @@ describe("Recipe tech-step corrections", () => {
|
|||
source: "manual",
|
||||
ingredients: [],
|
||||
utensils: [],
|
||||
temperatures: [],
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
|
@ -319,6 +321,7 @@ describe("Recipe tech-step corrections", () => {
|
|||
source: "manual",
|
||||
},
|
||||
],
|
||||
temperatures: [],
|
||||
},
|
||||
]);
|
||||
expect(res.body.techSteps[0].ingredients[0].ingredient.id).to.equal(butterId);
|
||||
|
|
|
|||
Loading…
Reference in a new issue