From a61e1f7637f1829f611fa2fcef2c00874dee6343 Mon Sep 17 00:00:00 2001 From: crc <> Date: Tue, 7 Jun 2022 11:26:33 +0000 Subject: [PATCH] patch glossary tool to allow larger words.tsv source data set FossilOrigin-Name: 981044535d7838de23111d2734a6ffb5867e4907d55a847536bb300688b6c1ed --- tools/glossary.retro | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/glossary.retro b/tools/glossary.retro index 5315672..26d1bcb 100755 --- a/tools/glossary.retro +++ b/tools/glossary.retro @@ -73,7 +73,7 @@ contents. ~~~ I next define words to access each field. This involves helpers -to skip over fields I'm not intersted in, a word to return a +to skip over fields I'm not intersted in, a word to return a specific field, and the top level wrappers over these. Rather than manually enter each of the field accessors, I am @@ -254,7 +254,10 @@ There are five primary roles: :matched? (-f) field:name TARGET s:eq? ; ---reveal--- :find-and-display-entry - 'doc/words.tsv [ s:keep !SourceLine matched? [ display-result ] if ] file:for-each-line ; + 'doc/words.tsv + [ &Heap + [ s:keep !SourceLine matched? [ display-result ] if ] v:preserve + ] file:for-each-line ; }} ~~~ @@ -491,15 +494,15 @@ a separator bar between each entry. :horizontal-line #72 [ $- c:put ] times nl nl ; :export-glossary 'doc/words.tsv - [ s:keep !SourceLine display-result horizontal-line ] file:for-each-line ; + [ &Heap [ s:keep !SourceLine display-result horizontal-line ] v:preserve ] file:for-each-line ; :export-concise 'doc/words.tsv - [ s:keep !SourceLine display-concise-result ] file:for-each-line ; + [ &Heap [ s:keep !SourceLine display-concise-result ] v:preserve ] file:for-each-line ; :export-concise-stack 'doc/words.tsv - [ s:keep !SourceLine display-concise-result ] file:for-each-line ; + [ &Heap [ s:keep !SourceLine display-concise-result ] v:preserve ] file:for-each-line ; ~~~ @@ -507,8 +510,8 @@ a separator bar between each entry. ~~~ :export-html - 'doc/words.tsv [ s:keep !SourceLine - display-result '
s:put nl ] file:for-each-line ; + 'doc/words.tsv [ &Heap [ s:keep !SourceLine + display-result '
s:put nl ] v:preserve ] file:for-each-line ; ~~~ #### TSV