Browse Source

cleaned up (though too late for devilery)

master
mortie 7 years ago
parent
commit
0be9614a41
1 changed files with 8 additions and 26 deletions
  1. 8
    26
      inf2810/hw3.a/oppgave.scm

+ 8
- 26
inf2810/hw3.a/oppgave.scm View File

@@ -69,34 +69,18 @@
;; 2 ;;
;;;;;;;

;; Tabell fra 2b

;; (define (make-table)
;; (list '*table*))
;;
;; (define (table-lookup key table)
;; (let ((record (assoc key (cdr table))))
;; (and record (cdr record))))
;;
;; (define (table-insert! key value table)
;; (let ((record (assoc key (cdr table))))
;; (if record
;; (set-cdr! record value)
;; (set-cdr! table
;; (cons (cons key value) (cdr table))))))

;; Node for the binary tree table.
;; Arguments:
;; k: Key
;; v: Value
;; l: Left child
;; r: Right child

;; Make table (implemented as a binary tree).
;; Arguments:
;; eq: Predicate for equality.
;; lt: Predicate for less than.
(define (make-table eq lt)

;; Node for the binary tree table.
;; Arguments:
;; k: Key
;; v: Value
;; l: Left child
;; r: Right child
(define (make-node k v l r)
(list k v l r))
@@ -329,6 +313,4 @@
(display (lm-score lm (car sentences)))
(newline)
(iter2 lm (cdr sentences)))))
(iter2 lm (read-corpus "test.txt"))

(lm-lookup-bigram lm "illegal," "unfair"))
(iter2 lm (read-corpus "test.txt")))

Loading…
Cancel
Save