forked from webyrd/mediKanren
-
Notifications
You must be signed in to change notification settings - Fork 0
/
string-search-config.rkt
44 lines (34 loc) · 1.04 KB
/
string-search-config.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#lang racket
;; This file is private to string-search.rkt.
;; Applications should include string-search.rkt instead.
(provide
field-indexed
schema-pri
name-ornull-from-pri
name-from-pri
uri-from-pri
fn-concept-name-corpus
fn-concept-name-index
fn-cprop-primary
)
;;;; Isolate here the configuration of string-search (currently hard-coded).
;; For now, we only index the field called "name"
(define field-indexed "name")
(define schema-pri '(string string string))
;;; *** data transformation for ingest ***
(define (name-ornull-from-pri v)
(let* (
(fd (list-ref v 1))
(name (list-ref v 2)))
(if (equal? fd field-indexed)
`(,name)
'())))
;;; *** data transformation for egress ***
(define (name-from-pri pri)
(list-ref pri 2))
(define (uri-from-pri pri)
(list-ref pri 0))
;;;; Filenames
(define fn-concept-name-corpus "concept-name-corpus.scm") ; only for build-name-string-search-v1
(define fn-concept-name-index "concept-name-index.bytes")
(define fn-cprop-primary "primary.value.table")