require('common.php');
-// $songHashMap = foldMap(
-// ☐(∘(field(0), delemit(' ')))(∘(field(5), delemit('/')))
-// )(foldMap(∘(lines, 'trim', 'file_get_contents'))(glob(PATH_TO_GROOVENET . '/songs.*.txt')));
+$c = lines(trim(file_get_contents(glob(PATH_TO_GROOVENET . '/songs.*.txt')[0])));
+$songHashMap = [];
-$songHashMap = foldMap(
- function($line) {
- $delim = delemit('/')($line);
- return [explode(' ', $line)[0] => $delim[4] . '/' . $delim[5]];
- }
-)(foldMap(∘(lines, 'trim', 'file_get_contents'))(glob(PATH_TO_GROOVENET . '/songs.*.txt')));
+foreach ($c as $v) {
+ $slash = explode('/', $v);
+ $songHashMap[explode(' ', $v)[0]] = $slash[4] . '/' . $slash[5];
+}
file_put_contents(__DIR__ . '/hashmap.txt', serialize($songHashMap));