Skip to content

Commit

Permalink
Add some doc and ensure triggers are generated
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerbinns committed Nov 25, 2024
1 parent fc03a1c commit 4f85be1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tools/recipe.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/usr/bin/env python3

import apsw, apsw.ext, apsw.fts5
# This processes an open recipes database and is used in the fuil text
# search example code.
#
# The recipes are mentioned here https://opendata.stackexchange.com/a/17386
# and the url is https://s3.amazonaws.com/openrecipes/20170107-061401-recipeitems.json.gz
# if you search for the filename you can find copies in other places

import apsw
import apsw.ext
import apsw.fts5
import json
import sys
import gzip
Expand Down Expand Up @@ -40,6 +49,7 @@ def content():
columns=None,
content="recipes",
tokenize=["simplify", "casefold", "true", "strip", "true", "unicodewords"],
generate_triggers=True,
)

with apsw.ext.ShowResourceUsage(sys.stdout, db=con, scope="process"):
Expand All @@ -50,4 +60,5 @@ def content():
columns=None,
content="recipes",
tokenize=["simplify", "casefold", "true", "strip", "true", "ngram"],
generate_triggers=True,
)

0 comments on commit 4f85be1

Please sign in to comment.