forked from kristjan/cjvt-valency
added QUERY_LIMIT to app.py
This commit is contained in:
@@ -40,6 +40,7 @@ CORPORA = ["ssj", "kres"]
|
||||
app_index = None
|
||||
sskj_wordlist = None # used by _is_banned(hw)
|
||||
BANNED_HEADWORDS = ["biti"]
|
||||
QUERY_LIMIT = 1000 # Some headwords contain thousands of examples - not practical for the app
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
valdb = None
|
||||
@@ -253,7 +254,7 @@ def api_get_frames():
|
||||
|
||||
cur = valdb[corpus].find({"headwords": hw})
|
||||
frames = []
|
||||
for ent in cur:
|
||||
for ent in cur[:QUERY_LIMIT]:
|
||||
frames += frames_from_db_entry(ent) # pre-process this step for prod TODO
|
||||
|
||||
# filter by relevant hw
|
||||
@@ -305,7 +306,7 @@ def api_get_functor_frames():
|
||||
|
||||
cur = valdb[corpus].find({"functors": functor})
|
||||
frames = []
|
||||
for ent in cur:
|
||||
for ent in cur[:QUERY_LIMIT]:
|
||||
frames += frames_from_db_entry(ent) # pre-process this step for prod TODO
|
||||
|
||||
# filter by relevant functor
|
||||
|
||||
Reference in New Issue
Block a user