From e8548eedd05b914bae6636edaeb83d29939f83af Mon Sep 17 00:00:00 2001 From: wes Date: Sun, 2 Apr 2017 16:43:51 -0400 Subject: [PATCH] remove old mapping --- course.json | 1 - course_mapping.rkt | 19 ------------- schemadsl.rkt | 69 ---------------------------------------------- 3 files changed, 89 deletions(-) delete mode 100644 course.json delete mode 100755 course_mapping.rkt delete mode 100644 schemadsl.rkt diff --git a/course.json b/course.json deleted file mode 100644 index d491bd7..0000000 --- a/course.json +++ /dev/null @@ -1 +0,0 @@ -{"course":{"properties":{"textbooks":{"properties":{"author":{"type":"string","index":"analyzed"},"title":{"type":"string","index":"analyzed"},"price":{"type":"string","index":"analyzed"}}},"sections":{"properties":{"sem":{"type":"string","index":"not_analyzed"},"title":{"type":"string","index":"analyzed"},"prof":{"type":"string","index":"analyzed"},"loc":{"type":"string","index":"analyzed"},"time":{"type":"string","index":"analyzed"},"day":{"type":"string","index":"analyzed"}}}}}} diff --git a/course_mapping.rkt b/course_mapping.rkt deleted file mode 100755 index fd52bb5..0000000 --- a/course_mapping.rkt +++ /dev/null @@ -1,19 +0,0 @@ -#! /usr/bin/racket -#lang racket -(require "schemadsl.rkt") - -(displayln - (make-mapping - "course" - `(,(estruct "sections" - `(,(str "title") - ,(str "time") - ,(str "loc") - ,(str "prof") - ,(atom "sem") - ,(str "day"))) - - ,(estruct "textbooks" - `(,(str "title") - ,(str "author") - ,(str "price")))))) diff --git a/schemadsl.rkt b/schemadsl.rkt deleted file mode 100644 index c84baab..0000000 --- a/schemadsl.rkt +++ /dev/null @@ -1,69 +0,0 @@ -#lang racket - -(require json) - -(define (root name type) - `(,name type)) - -(define ((prop - type - [index "analyzed"]) - name) - (define prop-hash (make-hash)) - (hash-set! prop-hash (string->symbol name) - `#hash( - (type . ,type) - (index . ,index))) - prop-hash) - -(define ((dict name) ps) - (let ([prop-vals (make-hash)] - [props-hsh (make-hash)]) - (for ([p ps]) - (hash-set! prop-vals - (car p) - (cdr p))) - (hash-set! props-hsh name prop-vals) - props-hsh)) - -(define (props ps) - (define props-hash (make-hash)) - (for ([p ps]) - (match p - [(hash-table (k v)) - (hash-set! props-hash k v)])) - `#hash((properties . ,props-hash))) - -(define str (prop "string")) - -(define atom (prop "string" "not_analyzed")) - -(define num (prop "integer")) - -(define date (prop "date")) - -(define bool (prop "boolean" "not_analyzed")) - -(define (dictprop name d) - (define dict (make-hash)) - (hash-set! dict name d) - dict) - -(define (estruct name pairs) - (define estr (make-hash)) - (hash-set! estr - (string->symbol name) - (props pairs)) - estr) - -(define (make-mapping - type - decl) - (define mapping (make-hash)) - (hash-set! mapping - (string->symbol type) - (props decl)) - (jsexpr->string mapping)) - -(provide - (all-defined-out))