aboutsummaryrefslogtreecommitdiff
path: root/parse.js
diff options
context:
space:
mode:
Diffstat (limited to 'parse.js')
-rw-r--r--parse.js51
1 files changed, 0 insertions, 51 deletions
diff --git a/parse.js b/parse.js
index c3b7684..77e7b52 100644
--- a/parse.js
+++ b/parse.js
@@ -1,54 +1,3 @@
-/*let i = 0;
- let foodShiftNames = [];
- let db = []; // first level array: days - second level array: shifts - third level dict: course/teacher - fourth level array: indexes
- while (db.length < weekdays.length)
- {
- i = findExpression(data, weekdays[db.length], i);
- let end = i;
- if (db.length === weekdays.length)
- end = data.length;
- else
- end = findExpression(data, weekdays[db.length + 1], i + 1);
-
- db.push([]); // add the day
- let shifts = 0;
-
- do
- {
- let teachers = [];
- let courses = [];
- i = findExpression(data, "RUOKAILUVUORO", i);
- let nextLineStart = getNextChar(data, i, "\n");
- foodShiftNames.push(data.substring(i, nextLineStart));
- db[db.length - 1].push([]); // add the food shift
- nextLineStart = getNextChar(data, nextLineStart + 1, "\n");
- while (!((nextLineStart - i) > 2))
- {
- i = nextLineStart;
- nextLineStart = getNextChar(data, i + 1, "\n");
- }
- let parsedLine = data.substring(i, nextLineStart).replaceAll(",", "").replaceAll("ja ", "");
- let parse_i = 0;
- let nextSpace = getNextChar(parsedLine, parse_i, " ");
- while (parse_i !== -1)
- {
- courses.push(parsedLine.substring(parse_i, nextSpace));
- parse_i = nextSpace + 1;
- nextSpace = getNextChar(parsedLine, parse_i, " ");
- teachers.push(parsedLine.substring(parse_i, nextSpace));
- parse_i = nextSpace + 1;
- nextSpace = getNextChar(parsedLine, parse_i, " ");
- }
- i = nextLineStart;
- db[db.length - 1][shifts][0] = courses;
- db[db.length - 1][shifts][1] = teachers;
- shifts++;
- } while ((i < end) && (i !== -1))
-
- i = getNextChar("\n");
- }
- return [db, foodShiftNames];*/
-
function getCharAmount(s, c)
{
let n = 0;