]> gitweb.factorcode.org Git - factor.git/commitdiff
help.html: quick fix for qualified searching of words
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 19 Jun 2022 00:37:27 +0000 (17:37 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 19 Jun 2022 00:37:27 +0000 (17:37 -0700)
basis/help/html/html.factor

index c5bf485ea312f9573f4c4ce27a4278e9dbb91d8d..6b3cfa9d52bef87df71ab4ce534b8836df3deac3 100644 (file)
@@ -303,8 +303,15 @@ MEMO: load-index ( name -- index )
 : article-apropos ( string -- results )
     "articles.idx" offline-apropos ;
 
-: word-apropos ( string -- results )
-    "words.idx" offline-apropos ;
-
 : vocab-apropos ( string -- results )
     "vocabs.idx" offline-apropos ;
+
+: qualified-index ( str index -- str index' )
+    over ":" split1 [
+        drop vocab-apropos values [ "," ".html" surround ] map
+        '[ drop _ [ tail? ] with any? ] dupd assoc-filter
+        [ over ".html" ?tail drop "," split1-last nip swap ":" glue ] assoc-map append
+    ] [ drop ] if* ;
+
+: word-apropos ( string -- results )
+    "words.idx" load-index qualified-index completions ;