ilar06 commited on
Commit
a2f2f2b
1 Parent(s): 81b9d8b

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +3 -8
index.html CHANGED
@@ -75,20 +75,15 @@
75
  });
76
  });
77
 
78
- async function analyzeNutrition(text) {
79
 
80
- // Log the extracted text for debugging, see whether to keep or not
81
- console.log("Analyzing text:", text);
82
 
83
  // Extract nutritional values (assuming sugar content is labeled as '당류' in Korean)
84
- const regex = /당류\s*[::]\s*(\d+(\.\d+)?)\s*([gG]|그램)/;
85
- // /당류\s*:\s*(\d+(\.\d+)?)\s*g\s*/; // This regex might need adjustments based on label format
86
  const match = text.match(regex);
87
 
88
- // Log the match result for debugging, see whether to keep
89
- console.log("Match result:", match);
90
 
91
- // see if to put again let outputDiv = document.getElementById('output');
92
 
93
  if (match) {
94
  const sugarContent = parseFloat(match[1]);
 
75
  });
76
  });
77
 
78
+ function analyzeNutrition(text) {
79
 
 
 
80
 
81
  // Extract nutritional values (assuming sugar content is labeled as '당류' in Korean)
82
+ const regex = /당류\s*:\s*(\d+(\.\d+)?)\s*g\s*/; // This regex might need adjustments based on label format
 
83
  const match = text.match(regex);
84
 
 
 
85
 
86
+ let outputDiv = document.getElementById('output');
87
 
88
  if (match) {
89
  const sugarContent = parseFloat(match[1]);