Spaces:
Sleeping
Sleeping
yukiapple323
commited on
Commit
•
4d2fe33
1
Parent(s):
3109812
Update index.html
Browse files- index.html +2 -1
index.html
CHANGED
@@ -79,7 +79,8 @@
|
|
79 |
function analyzeNutrition(text) {
|
80 |
// Extract sugar content from the recognized text
|
81 |
// const sugarMatch = text.match(/(\d+(\.\d+)?)(\s*(g|grams|그램))/i);
|
82 |
-
|
|
|
83 |
if (sugarMatch) {
|
84 |
const sugarContent = parseFloat(sugarMatch[1]);
|
85 |
let message = `Sugar content: ${sugarContent}g - `;
|
|
|
79 |
function analyzeNutrition(text) {
|
80 |
// Extract sugar content from the recognized text
|
81 |
// const sugarMatch = text.match(/(\d+(\.\d+)?)(\s*(g|grams|그램))/i);
|
82 |
+
// const sugarMatch = text.match(/당[^\d]*(\d+(\.\d+)?)\s*(g|grams|그램)/i);
|
83 |
+
const sugarMatch = text.match(/(당[^\d]*)(\d+(\.\d+)?)(\s*(g|grams|그램))/i);
|
84 |
if (sugarMatch) {
|
85 |
const sugarContent = parseFloat(sugarMatch[1]);
|
86 |
let message = `Sugar content: ${sugarContent}g - `;
|