Do not build .sxml intermediate files anymore
Makefile
50 | 50 | head -n20000 $@.tmp > $@ | |
51 | 51 | rm $@.tmp | |
52 | 52 | ||
53 | - | dictionaries/%.sxml: dictionaries/%.xml tools/jmdict.scm | |
54 | - | guile -L modules tools/jmdict.scm convert $< nolang $@ | |
55 | - | ||
56 | 53 | dicos/JMdict_%.nani: dictionaries/JMdict.xml tools/jmdict.scm dictionaries/frequency.tsv $(DICO_MODULES) | |
57 | 54 | guile -L modules tools/jmdict.scm build \ | |
58 | 55 | $< $(shell echo $@ | sed 's|^.*_\([^.]*\)\..*$$|\1|g') $@ |
tools/jmdict.scm
25 | 25 | (use-modules (ice-9 match)) | |
26 | 26 | (use-modules (ice-9 binary-ports)) | |
27 | 27 | ||
28 | - | (define (convert input output) | |
29 | - | (let ((sxml (load-dic input))) | |
30 | - | (call-with-output-file output | |
31 | - | (lambda (port) | |
32 | - | (write sxml port))))) | |
33 | - | ||
34 | 28 | ;; Break these steps to try and let the GC reclaim these big objects | |
35 | 29 | (define (get-results1 input frq) | |
36 | 30 | (call-with-input-file input | |
… | |||
71 | 65 | (if (equal? lang "e") | |
72 | 66 | (compile input (const #t) output) | |
73 | 67 | (compile input (lambda (sense) (equal? (sense-language sense) lang)) output))) | |
74 | - | ((equal? cmd "convert") | |
75 | - | (convert input output)) | |
76 | 68 | (else (format #t "Unknown cmd ~a.~%" cmd)))) | |
77 | 69 | ((_ "print" word input) | |
78 | 70 | (print word input))) |
tools/wadoku.scm
68 | 68 | (if (equal? lang "e") | |
69 | 69 | (compile input (const #t) output) | |
70 | 70 | (compile input (lambda (sense) (equal? (sense-language sense) lang)) output))) | |
71 | - | ((equal? cmd "convert") | |
72 | - | (convert input output)) | |
73 | 71 | (else (format #t "Unknown cmd ~a.~%" cmd)))) | |
74 | 72 | ((_ "print" word input) | |
75 | 73 | (print word input))) |