%load_ext autoreload
%autoreload 2
from tf.app import use
from utils import prof
def perf(func, *args, **kwargs):
return prof(func, locals(), globals(), *args, **kwargs)
A = use('bhsa:clone', checkout='clone', hoist=globals(), silent='deep')
silentOff()
def qup(query, limit=0):
print(f'QUERY=\n{query}\n')
indent(reset=True)
silentOff()
info('STUDY ...')
S.study(query)
info('STUDY DONE ...')
S.showPlan(details=True)
info('FETCH ...')
results = perf(S.fetch, limit=limit)
info('FETCH DONE ...')
if results:
print('\n'.join(str(r) for r in results[0:10]))
print(f'{len(results)} results')
query = '''
phrase
= phrase
'''
qup(query)
QUERY= phrase = phrase 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.08s Constraining search space with 1 relations ... 0.08s 0 edges thinned 0.08s Setting up retrieval plan with strategy small_choice_multi ... 0.09s Ready to deliver results from 506414 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.09s STUDY DONE ... Search with 2 objects and 1 relations Results are instantiations of the following objects: node 0-phrase 253207 choices node 1-phrase 253207 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-phrase 253207 choices edge 0-phrase = 1-phrase 1.0 choices 0.10s The results are connected to the original search template as follows: 0 1 R0 phrase 2 R1 = phrase 3 0.10s FETCH ... 3544907 function calls (2532079 primitive calls) in 1.181 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 1.181 1.181 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.117 0.117 1.180 1.180 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 253208 0.047 0.000 1.019 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 1266036/253208 0.818 0.000 0.973 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 759621 0.093 0.000 0.093 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 759624 0.058 0.000 0.058 0.000 {built-in method builtins.len} 253207 0.028 0.000 0.028 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:60(<lambda>) 253207 0.021 0.000 0.021 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1.28s FETCH DONE ... (651542, 651542) (651543, 651543) (651544, 651544) (651545, 651545) (651546, 651546) (651547, 651547) (651548, 651548) (651549, 651549) (651550, 651550) (651551, 651551) 253207 results
qup(query)
QUERY= phrase = phrase 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.08s Constraining search space with 1 relations ... 0.09s 0 edges thinned 0.09s Setting up retrieval plan with strategy small_choice_multi ... 0.10s Ready to deliver results from 506414 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.10s STUDY DONE ... Search with 2 objects and 1 relations Results are instantiations of the following objects: node 0-phrase 253207 choices node 1-phrase 253207 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-phrase 253207 choices edge 0-phrase = 1-phrase 1.0 choices 0.11s The results are connected to the original search template as follows: 0 1 R0 phrase 2 R1 = phrase 3 0.11s FETCH ... 3798114 function calls (2785286 primitive calls) in 1.197 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 1.197 1.197 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.123 0.123 1.197 1.197 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 253208 0.047 0.000 1.034 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 1266036/253208 0.823 0.000 0.987 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 759621 0.088 0.000 0.088 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 759624 0.056 0.000 0.056 0.000 {built-in method builtins.len} 506414 0.041 0.000 0.041 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:63(xx) 253207 0.019 0.000 0.019 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1.31s FETCH DONE ... (651542, 651542) (651543, 651543) (651544, 651544) (651545, 651545) (651546, 651546) (651547, 651547) (651548, 651548) (651549, 651549) (651550, 651550) (651551, 651551) 253207 results
query = '''
phrase
== phrase_atom
'''
qup(query)
QUERY= phrase == phrase_atom 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.09s Constraining search space with 1 relations ... 0.10s 0 edges thinned 0.10s Setting up retrieval plan with strategy small_choice_multi ... 0.10s Ready to deliver results from 520748 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.10s STUDY DONE ... Search with 2 objects and 1 relations Results are instantiations of the following objects: node 0-phrase 253207 choices node 1-phrase_atom 267541 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-phrase 253207 choices edge 0-phrase == 1-phrase_atom 0.9 choices 0.11s The results are connected to the original search template as follows: 0 1 R0 phrase 2 R1 == phrase_atom 3 0.11s FETCH ... 4216350 function calls (3232922 primitive calls) in 2.195 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 2.195 2.195 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.125 0.125 2.194 2.194 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 243408 0.053 0.000 2.024 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 1226836/243408 1.109 0.000 1.971 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 253207 0.260 0.000 0.284 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:178(xx) 362594 0.245 0.000 0.245 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:187(<genexpr>) 163442 0.192 0.000 0.192 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:188(<genexpr>) 730221 0.101 0.000 0.101 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 993231 0.086 0.000 0.086 0.000 {built-in method builtins.len} 243407 0.022 0.000 0.022 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 2.31s FETCH DONE ... (651542, 904749) (651543, 904750) (651544, 904751) (651545, 904752) (651546, 904753) (651547, 904754) (651548, 904755) (651549, 904756) (651550, 904757) (651551, 904758) 243407 results
qup(query)
QUERY= phrase == phrase_atom 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.09s Constraining search space with 1 relations ... 0.09s 0 edges thinned 0.10s Setting up retrieval plan with strategy small_choice_multi ... 0.10s Ready to deliver results from 520748 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.11s STUDY DONE ... Search with 2 objects and 1 relations Results are instantiations of the following objects: node 0-phrase 253207 choices node 1-phrase_atom 267541 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-phrase 253207 choices edge 0-phrase == 1-phrase_atom 0.9 choices 0.11s The results are connected to the original search template as follows: 0 1 R0 phrase 2 R1 == phrase_atom 3 0.11s FETCH ... 4390803 function calls (3407375 primitive calls) in 1.857 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 1.857 1.857 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.116 0.116 1.857 1.857 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 243408 0.050 0.000 1.699 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 1226836/243408 0.932 0.000 1.650 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 953696 0.573 0.000 0.594 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:147(xx) 730221 0.091 0.000 0.091 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 993231 0.075 0.000 0.075 0.000 {built-in method builtins.len} 243407 0.020 0.000 0.020 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1.97s FETCH DONE ... (651542, 904749) (651543, 904750) (651544, 904751) (651545, 904752) (651546, 904753) (651547, 904754) (651548, 904755) (651549, 904756) (651550, 904757) (651551, 904758) 243407 results
query = '''
phrase
&& phrase_atom
'''
qup(query)
QUERY= phrase && phrase_atom 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.09s Constraining search space with 1 relations ... 0.09s 0 edges thinned 0.09s Setting up retrieval plan with strategy small_choice_multi ... 0.11s Ready to deliver results from 520748 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.11s STUDY DONE ... Search with 2 objects and 1 relations Results are instantiations of the following objects: node 0-phrase 253207 choices node 1-phrase_atom 267541 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-phrase 253207 choices edge 0-phrase && 1-phrase_atom 1.1 choices 0.11s The results are connected to the original search template as follows: 0 1 R0 phrase 2 R1 && phrase_atom 3 0.12s FETCH ... 4635579 function calls (3579749 primitive calls) in 2.358 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 2.358 2.358 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.130 0.130 2.358 2.358 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 267542 0.054 0.000 2.183 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 1323372/267542 1.285 0.000 2.129 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 253207 0.571 0.000 0.705 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:249(xx) 679791 0.107 0.000 0.107 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:252(<genexpr>) 802623 0.099 0.000 0.099 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 788292 0.065 0.000 0.065 0.000 {built-in method builtins.len} 253207 0.027 0.000 0.027 0.000 {built-in method from_iterable} 267541 0.020 0.000 0.020 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 2.48s FETCH DONE ... (651542, 904749) (651543, 904750) (651544, 904751) (651545, 904752) (651546, 904753) (651547, 904754) (651548, 904755) (651549, 904756) (651550, 904757) (651551, 904758) 267541 results
qup(query)
QUERY= phrase && phrase_atom 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.09s Constraining search space with 1 relations ... 0.10s 0 edges thinned 0.10s Setting up retrieval plan with strategy small_choice_multi ... 0.11s Ready to deliver results from 520748 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.11s STUDY DONE ... Search with 2 objects and 1 relations Results are instantiations of the following objects: node 0-phrase 253207 choices node 1-phrase_atom 267541 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-phrase 253207 choices edge 0-phrase && 1-phrase_atom 1.0 choices 0.12s The results are connected to the original search template as follows: 0 1 R0 phrase 2 R1 && phrase_atom 3 0.12s FETCH ... 10733036 function calls (9200077 primitive calls) in 2.948 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 2.948 2.948 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.184 0.184 2.948 2.948 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 426585 0.077 0.000 2.700 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 1959544/426585 1.876 0.000 2.623 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 5534189 0.563 0.000 0.563 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:274(xx) 1279752 0.142 0.000 0.142 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 1106378 0.076 0.000 0.076 0.000 {built-in method builtins.len} 426584 0.030 0.000 0.030 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 3.07s FETCH DONE ... (651542, 904749) (651542, 904749) (651543, 904750) (651544, 904751) (651545, 904752) (651545, 904752) (651545, 904752) (651545, 904752) (651545, 904752) (651545, 904752) 426584 results
query = '''
phrase_atom
]] phrase
'''
qup(query)
QUERY= phrase_atom ]] phrase 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.08s Constraining search space with 1 relations ... 0.09s 0 edges thinned 0.09s Setting up retrieval plan with strategy small_choice_multi ... 0.10s Ready to deliver results from 520748 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.10s STUDY DONE ... Search with 2 objects and 1 relations Results are instantiations of the following objects: node 0-phrase_atom 267541 choices node 1-phrase 253207 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 1-phrase 253207 choices edge 1-phrase [[ 0-phrase_atom 1.1 choices 0.11s The results are connected to the original search template as follows: 0 1 R0 phrase_atom 2 R1 ]] phrase 3 0.11s FETCH ... 3702581 function calls (2646751 primitive calls) in 1.197 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 1.197 1.197 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.124 0.124 1.197 1.197 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 267542 0.049 0.000 1.030 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 1323372/267542 0.815 0.000 0.982 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 802623 0.093 0.000 0.093 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 788292 0.056 0.000 0.056 0.000 {built-in method builtins.len} 253207 0.041 0.000 0.041 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:327(<lambda>) 267541 0.019 0.000 0.019 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1.31s FETCH DONE ... (904749, 651542) (904750, 651543) (904751, 651544) (904752, 651545) (904753, 651546) (904754, 651547) (904755, 651548) (904756, 651549) (904757, 651550) (904758, 651551) 267541 results
qup(query)
QUERY= phrase_atom ]] phrase 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.09s Constraining search space with 1 relations ... 0.09s 0 edges thinned 0.09s Setting up retrieval plan with strategy small_choice_multi ... 0.10s Ready to deliver results from 520748 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.10s STUDY DONE ... Search with 2 objects and 1 relations Results are instantiations of the following objects: node 0-phrase_atom 267541 choices node 1-phrase 253207 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 1-phrase 253207 choices edge 1-phrase [[ 0-phrase_atom 1.1 choices 0.11s The results are connected to the original search template as follows: 0 1 R0 phrase_atom 2 R1 ]] phrase 3 0.12s FETCH ... 4116632 function calls (3060802 primitive calls) in 1.216 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 1.216 1.216 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.108 0.108 1.216 1.216 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 267542 0.047 0.000 1.069 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 1323372/267542 0.808 0.000 1.022 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 667258 0.097 0.000 0.097 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:352(xx) 802623 0.085 0.000 0.085 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 788292 0.054 0.000 0.054 0.000 {built-in method builtins.len} 267541 0.017 0.000 0.017 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1.33s FETCH DONE ... (904749, 651542) (904750, 651543) (904751, 651544) (904752, 651545) (904753, 651546) (904754, 651547) (904755, 651548) (904756, 651549) (904757, 651550) (904758, 651551) 267541 results
query = '''
phrase
:: phrase_atom
'''
qup(query)
QUERY= phrase :: phrase_atom 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.09s Constraining search space with 1 relations ... 0.10s 0 edges thinned 0.10s Setting up retrieval plan with strategy small_choice_multi ... 0.11s Ready to deliver results from 520748 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.11s STUDY DONE ... Search with 2 objects and 1 relations Results are instantiations of the following objects: node 0-phrase 253207 choices node 1-phrase_atom 267541 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-phrase 253207 choices edge 0-phrase :: 1-phrase_atom 1.0 choices 0.11s The results are connected to the original search template as follows: 0 1 R0 phrase 2 R1 :: phrase_atom 3 0.12s FETCH ... 3437107 function calls (2453679 primitive calls) in 1.389 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 1.389 1.389 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.104 0.104 1.389 1.389 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 243408 0.044 0.000 1.248 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 1226836/243408 0.784 0.000 1.204 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 253207 0.311 0.000 0.311 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:488(xx) 730221 0.079 0.000 0.079 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 740024 0.051 0.000 0.051 0.000 {built-in method builtins.len} 243407 0.017 0.000 0.017 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1.51s FETCH DONE ... (651542, 904749) (651543, 904750) (651544, 904751) (651545, 904752) (651546, 904753) (651547, 904754) (651548, 904755) (651549, 904756) (651550, 904757) (651551, 904758) 243407 results
qup(query)
QUERY= phrase :: phrase_atom 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.09s Constraining search space with 1 relations ... 0.09s 0 edges thinned 0.09s Setting up retrieval plan with strategy small_choice_multi ... 0.10s Ready to deliver results from 520748 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.10s STUDY DONE ... Search with 2 objects and 1 relations Results are instantiations of the following objects: node 0-phrase 253207 choices node 1-phrase_atom 267541 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-phrase 253207 choices edge 0-phrase :: 1-phrase_atom 0.9 choices 0.11s The results are connected to the original search template as follows: 0 1 R0 phrase 2 R1 :: phrase_atom 3 0.11s FETCH ... 3437107 function calls (2453679 primitive calls) in 1.387 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 1.387 1.387 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.103 0.103 1.387 1.387 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 243408 0.045 0.000 1.246 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 1226836/243408 0.784 0.000 1.200 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 253207 0.307 0.000 0.307 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:475(xx) 730221 0.079 0.000 0.079 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 740024 0.052 0.000 0.052 0.000 {built-in method builtins.len} 243407 0.017 0.000 0.017 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1.50s FETCH DONE ... (651542, 904749) (651543, 904750) (651544, 904751) (651545, 904752) (651546, 904753) (651547, 904754) (651548, 904755) (651549, 904756) (651550, 904757) (651551, 904758) 243407 results
query = '''
clause
=: p1:phrase
p2:phrase
:=
s:phrase_atom
p1 < s
s < p2
'''
qup(query, limit=100)
QUERY= clause =: p1:phrase p2:phrase := s:phrase_atom p1 < s s < p2 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 4 objects ... 0.12s Constraining search space with 6 relations ... 0.61s 2 edges thinned 0.61s Setting up retrieval plan with strategy small_choice_multi ... 0.62s Ready to deliver results from 531904 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.63s STUDY DONE ... Search with 4 objects and 5 relations Results are instantiations of the following objects: node 0-clause 88121 choices node 1-phrase 88121 choices node 2-phrase 88121 choices node 3-phrase_atom 267541 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-clause 88121 choices edge 0-clause [[ 2-phrase 1.0 choices edge 2-phrase := 0-clause 0 choices edge 0-clause [[ 1-phrase 1.0 choices edge 1-phrase =: 0-clause 0 choices edge 2,1-phrase >,< 3-phrase_atom 13377.0 choices 0.63s The results are connected to the original search template as follows: 0 1 R0 clause 2 R1 =: p1:phrase 3 R2 p2:phrase 4 := 5 6 R3 s:phrase_atom 7 8 p1 < s 9 s < p2 10 0.64s FETCH ... 11633716 function calls (11632796 primitive calls) in 7.082 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 7.082 7.082 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.000 0.000 7.082 7.082 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 101 0.000 0.000 7.082 0.070 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 1021/101 4.736 0.005 7.082 0.070 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 11628126 2.345 0.000 2.345 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:85(<lambda>) 3265 0.001 0.000 0.001 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:75(<lambda>) 500 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 44 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:401(xx) 423 0.000 0.000 0.000 0.000 {built-in method builtins.len} 88 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:327(<lambda>) 44 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:375(xx) 100 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 7.72s FETCH DONE ... (427553, 651542, 651545, 904749) (427553, 651542, 651545, 904750) (427553, 651542, 651545, 904751) (427554, 651546, 651549, 904753) (427554, 651546, 651549, 904754) (427554, 651546, 651549, 904755) (427555, 651550, 651552, 904757) (427555, 651550, 651552, 904758) (427556, 651553, 651556, 904760) (427556, 651553, 651556, 904761) 100 results
query = '''
clause
=: p1:phrase
p2:phrase
:=
s:phrase_atom
p1 << s
s << p2
'''
qup(query, limit=100)
QUERY= clause =: p1:phrase p2:phrase := s:phrase_atom p1 << s s << p2 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 4 objects ... 0.12s Constraining search space with 6 relations ... 0.61s 2 edges thinned 0.61s Setting up retrieval plan with strategy small_choice_multi ... 0.63s Ready to deliver results from 531904 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.63s STUDY DONE ... Search with 4 objects and 5 relations Results are instantiations of the following objects: node 0-clause 88121 choices node 1-phrase 88121 choices node 2-phrase 88121 choices node 3-phrase_atom 267541 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-clause 88121 choices edge 0-clause [[ 2-phrase 1.0 choices edge 2-phrase := 0-clause 0 choices edge 0-clause [[ 1-phrase 1.0 choices edge 1-phrase =: 0-clause 0 choices edge 2,1-phrase >>,<< 3-phrase_atom 13109.5 choices 0.65s The results are connected to the original search template as follows: 0 1 R0 clause 2 R1 =: p1:phrase 3 R2 p2:phrase 4 := 5 6 R3 s:phrase_atom 7 8 p1 << s 9 s << p2 10 0.66s FETCH ... 21808817 function calls (21807707 primitive calls) in 15.570 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 15.570 15.570 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.000 0.000 15.570 15.570 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 101 0.000 0.000 15.569 0.154 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 1211/101 9.056 0.007 15.569 0.154 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 21794796 6.510 0.000 6.510 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:356(xx) 11164 0.003 0.000 0.003 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:341(<lambda>) 500 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 82 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:419(xx) 613 0.000 0.000 0.000 0.000 {built-in method builtins.len} 164 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:327(<lambda>) 82 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:393(xx) 100 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 16s FETCH DONE ... (427553, 651542, 651545, 904750) (427553, 651542, 651545, 904751) (427554, 651546, 651549, 904754) (427554, 651546, 651549, 904755) (427555, 651550, 651552, 904758) (427556, 651553, 651556, 904761) (427556, 651553, 651556, 904762) (427557, 651557, 651559, 904765) (427559, 651562, 651564, 904770) (427560, 651565, 651568, 904773) 100 results
query = '''
w1:word
<20: w2:word
w1 < w2
w1 .g_cons=g_cons. w2
w1 .lex#lex. w2
'''
qup(query)
QUERY= w1:word <20: w2:word w1 < w2 w1 .g_cons=g_cons. w2 w1 .lex#lex. w2 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.13s Constraining search space with 4 relations ... 0.17s 0 edges thinned 0.17s Setting up retrieval plan with strategy small_choice_multi ... 0.21s Ready to deliver results from 853168 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.21s STUDY DONE ... Search with 2 objects and 4 relations Results are instantiations of the following objects: node 0-word 426584 choices node 1-word 426584 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-word 426584 choices edge 0-word <20: 1-word 41.0 choices edge 0-word .g_cons=g_cons. 1-word 0 choices edge 1-word > 0-word 0 choices edge 0-word .lex#lex. 1-word 0 choices 0.22s The results are connected to the original search template as follows: 0 1 R0 w1:word 2 R1 <20: w2:word 3 4 w1 < w2 5 w1 .g_cons=g_cons. w2 6 w1 .lex#lex. w2 7 0.23s FETCH ... 93897532 function calls (74723835 primitive calls) in 32.819 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 32.819 32.819 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.003 0.003 32.819 32.819 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 3438 0.001 0.000 32.815 0.010 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 19177135/3438 17.460 0.000 32.815 0.010 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 17489523 6.480 0.000 13.337 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:817(uu) 35537012 6.976 0.000 6.976 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/api.py:146(v) 19159952 1.151 0.000 1.151 0.000 {built-in method builtins.len} 426584 0.326 0.000 0.532 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:724(<lambda>) 278983 0.116 0.000 0.234 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:902(uu) 426584 0.121 0.000 0.121 0.000 {built-in method builtins.max} 957985 0.098 0.000 0.098 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:83(<lambda>) 426584 0.085 0.000 0.085 0.000 {built-in method builtins.min} 10311 0.002 0.000 0.002 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 3437 0.001 0.000 0.001 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 33s FETCH DONE ... (528, 530) (599, 600) (599, 617) (600, 616) (616, 617) (875, 882) (882, 895) (886, 903) (895, 913) (903, 919) 3437 results
qup(query)
QUERY= w1:word <20: w2:word w1 < w2 w1 .g_cons=g_cons. w2 w1 .lex#lex. w2 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.12s Constraining search space with 4 relations ... 0.16s 0 edges thinned 0.16s Setting up retrieval plan with strategy small_choice_multi ... 0.21s Ready to deliver results from 853168 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.21s STUDY DONE ... Search with 2 objects and 4 relations Results are instantiations of the following objects: node 0-word 426584 choices node 1-word 426584 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-word 426584 choices edge 0-word <20: 1-word 41.0 choices edge 0-word .g_cons=g_cons. 1-word 0 choices edge 1-word > 0-word 0 choices edge 0-word .lex#lex. 1-word 0 choices 0.22s The results are connected to the original search template as follows: 0 1 R0 w1:word 2 R1 <20: w2:word 3 4 w1 < w2 5 w1 .g_cons=g_cons. w2 6 w1 .lex#lex. w2 7 0.22s FETCH ... 93897532 function calls (74723835 primitive calls) in 27.711 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 27.711 27.711 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.002 0.002 27.711 27.711 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 3438 0.001 0.000 27.708 0.008 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 19177135/3438 17.235 0.000 27.707 0.008 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 17489523 5.320 0.000 8.414 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:866(uu) 34979046 3.094 0.000 3.094 0.000 {method 'get' of 'dict' objects} 19159952 1.153 0.000 1.153 0.000 {built-in method builtins.len} 426584 0.325 0.000 0.532 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:728(<lambda>) 278983 0.126 0.000 0.263 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:951(uu) 557966 0.136 0.000 0.136 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/api.py:146(v) 426584 0.121 0.000 0.121 0.000 {built-in method builtins.max} 957985 0.109 0.000 0.109 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:87(<lambda>) 426584 0.086 0.000 0.086 0.000 {built-in method builtins.min} 10311 0.002 0.000 0.002 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 3437 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 28s FETCH DONE ... (528, 530) (599, 600) (599, 617) (600, 616) (616, 617) (875, 882) (882, 895) (886, 903) (895, 913) (903, 919) 3437 results
qup(query)
QUERY= w1:word <20: w2:word w1 < w2 w1 .g_cons=g_cons. w2 w1 .lex#lex. w2 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.13s Constraining search space with 4 relations ... 0.16s 0 edges thinned 0.16s Setting up retrieval plan with strategy small_choice_multi ... 0.21s Ready to deliver results from 853168 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.21s STUDY DONE ... Search with 2 objects and 4 relations Results are instantiations of the following objects: node 0-word 426584 choices node 1-word 426584 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-word 426584 choices edge 0-word <20: 1-word 41.0 choices edge 0-word .g_cons=g_cons. 1-word 0 choices edge 1-word > 0-word 0 choices edge 0-word .lex#lex. 1-word 0 choices 0.22s The results are connected to the original search template as follows: 0 1 R0 w1:word 2 R1 <20: w2:word 3 4 w1 < w2 5 w1 .g_cons=g_cons. w2 6 w1 .lex#lex. w2 7 0.23s FETCH ... 233813716 function calls (214640019 primitive calls) in 65.564 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 65.564 65.564 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.003 0.003 65.564 65.564 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 3438 0.014 0.000 65.560 0.019 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 19177135/3438 18.823 0.000 65.546 0.019 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 17489523 7.590 0.000 44.222 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:834(uu) 34979046 12.020 0.000 20.690 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/api.py:327(Fs) 17489523 6.314 0.000 18.517 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:831(<lambda>) 17489523 6.100 0.000 18.114 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:832(<lambda>) 34979046 5.109 0.000 5.109 0.000 {built-in method builtins.hasattr} 34979046 3.560 0.000 3.560 0.000 {built-in method builtins.getattr} 34979046 3.529 0.000 3.529 0.000 {method 'get' of 'dict' objects} 19159952 1.471 0.000 1.471 0.000 {built-in method builtins.len} 426584 0.382 0.000 0.617 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:728(<lambda>) 278983 0.145 0.000 0.295 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:950(uu) 557966 0.150 0.000 0.150 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/api.py:146(v) 426584 0.142 0.000 0.142 0.000 {built-in method builtins.max} 957985 0.116 0.000 0.116 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:87(<lambda>) 426584 0.093 0.000 0.093 0.000 {built-in method builtins.min} 10311 0.002 0.000 0.002 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 3437 0.001 0.000 0.001 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1m 06s FETCH DONE ... (528, 530) (599, 600) (599, 617) (600, 616) (616, 617) (875, 882) (882, 895) (886, 903) (895, 913) (903, 919) 3437 results
query = '''
verse
clause
p1:phrase
w1:word
w3:word
w1 < w3
p2:phrase
w2:word
w1 < w2
w3 > w2
p1 < p2
'''
qup(query)
QUERY= verse clause p1:phrase w1:word w3:word w1 < w3 p2:phrase w2:word w1 < w2 w3 > w2 p1 < p2 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 7 objects ... 0.24s Constraining search space with 10 relations ... 2.26s 6 edges thinned 2.26s Setting up retrieval plan with strategy small_choice_multi ... 2.32s Ready to deliver results from 1894478 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 2.32s STUDY DONE ... Search with 7 objects and 9 relations Results are instantiations of the following objects: node 0-verse 23207 choices node 1-clause 88071 choices node 2-phrase 253002 choices node 3-word 425732 choices node 4-word 425732 choices node 5-phrase 253002 choices node 6-word 425732 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-verse 23207 choices edge 0-verse [[ 1-clause 3.5 choices (thinned) edge 1-clause [[ 2-phrase 2.9 choices (thinned) edge 2-phrase [[ 3-word 1.5 choices (thinned) edge 2-phrase [[ 4-word 1.9 choices (thinned) edge 3-word < 4-word 0 choices edge 1-clause [[ 5-phrase 2.9 choices (thinned) edge 2-phrase < 5-phrase 0 choices edge 5-phrase [[ 6-word 1.4 choices (thinned) edge 4,3-word >,< 6-word 0 choices 2.34s The results are connected to the original search template as follows: 0 1 R0 verse 2 R1 clause 3 4 R2 p1:phrase 5 R3 w1:word 6 R4 w3:word 7 w1 < w3 8 9 R5 p2:phrase 10 R6 w2:word 11 w1 < w2 12 w3 > w2 13 14 p1 < p2 15 2.39s FETCH ... 14849210 function calls (9882723 primitive calls) in 7.281 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 7.281 7.281 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.004 0.004 7.281 7.281 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 7590 0.002 0.000 7.275 0.001 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 4974077/7590 6.107 0.000 7.274 0.001 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 1557088 0.392 0.000 0.392 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:79(<lambda>) 4898189 0.319 0.000 0.319 0.000 {built-in method builtins.len} 1370843 0.148 0.000 0.148 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:77(<lambda>) 880456 0.146 0.000 0.146 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:322(<lambda>) 574813 0.100 0.000 0.100 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:331(<lambda>) 517849 0.054 0.000 0.054 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:87(<lambda>) 60712 0.008 0.000 0.008 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 7589 0.001 0.000 0.001 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 9.68s FETCH DONE ... (1414409, 427767, 652186, 1159, 1161, 652187, 1160) (1414409, 427767, 652186, 1159, 1162, 652187, 1160) (1414409, 427767, 652186, 1159, 1163, 652187, 1160) (1414409, 427767, 652186, 1159, 1164, 652187, 1160) (1414437, 427889, 652543, 1720, 1722, 652544, 1721) (1414437, 427889, 652543, 1720, 1723, 652544, 1721) (1414609, 428386, 654141, 4819, 4825, 654142, 4821) (1414609, 428386, 654141, 4819, 4825, 654142, 4822) (1414609, 428386, 654141, 4819, 4825, 654142, 4823) (1414609, 428386, 654141, 4819, 4825, 654142, 4824) 7589 results
query = '''
verse
clause
p1:phrase
=: w1:word
w3:word
:=
p2:phrase
w2:word
w1 < w2
w2 < w3
p1 < p2
'''
qup(query)
QUERY= verse clause p1:phrase =: w1:word w3:word := p2:phrase w2:word w1 < w2 w2 < w3 p1 < p2 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 7 objects ... 0.25s Constraining search space with 11 relations ... 2.14s 7 edges thinned 2.14s Setting up retrieval plan with strategy small_choice_multi ... 2.19s Ready to deliver results from 1549018 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 2.20s STUDY DONE ... Search with 7 objects and 11 relations Results are instantiations of the following objects: node 0-verse 23207 choices node 1-clause 88071 choices node 2-phrase 253002 choices node 3-word 253002 choices node 4-word 253002 choices node 5-phrase 253002 choices node 6-word 425732 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-verse 23207 choices edge 0-verse [[ 1-clause 4.2 choices (thinned) edge 1-clause [[ 5-phrase 2.9 choices (thinned) edge 5-phrase [[ 6-word 1.3 choices (thinned) edge 1-clause [[ 2-phrase 3.2 choices (thinned) edge 5-phrase > 2-phrase 0 choices edge 2-phrase [[ 4-word 1.0 choices edge 4-word := 2-phrase 0 choices edge 6-word < 4-word 0 choices edge 2-phrase [[ 3-word 1.0 choices (thinned) edge 2-phrase =: 3-word 0 choices edge 6-word > 3-word 0 choices 2.21s The results are connected to the original search template as follows: 0 1 R0 verse 2 R1 clause 3 4 R2 p1:phrase 5 R3 =: w1:word 6 R4 w3:word 7 := 8 9 R5 p2:phrase 10 R6 w2:word 11 12 w1 < w2 13 w2 < w3 14 15 p1 < p2 16 2.27s FETCH ... 12118991 function calls (8076141 primitive calls) in 5.908 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 5.908 5.908 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.001 0.001 5.908 5.908 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 737 0.000 0.000 5.907 0.008 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 4043587/737 4.865 0.000 5.907 0.008 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 1411533 0.373 0.000 0.373 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:89(<lambda>) 4034757 0.269 0.000 0.269 0.000 {built-in method builtins.len} 863581 0.143 0.000 0.143 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:322(<lambda>) 609843 0.099 0.000 0.099 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:400(<lambda>) 537010 0.091 0.000 0.091 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:331(<lambda>) 609843 0.065 0.000 0.065 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:77(<lambda>) 5888 0.001 0.000 0.001 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 736 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:376(<lambda>) 736 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects} 736 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:87(<lambda>) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 8.17s FETCH DONE ... (1414409, 427767, 652186, 1159, 1164, 652187, 1160) (1414437, 427889, 652543, 1720, 1723, 652544, 1721) (1414609, 428386, 654141, 4819, 4828, 654142, 4821) (1414609, 428386, 654141, 4819, 4828, 654142, 4822) (1414609, 428386, 654141, 4819, 4828, 654142, 4823) (1414609, 428386, 654141, 4819, 4828, 654142, 4824) (1414669, 428569, 654717, 5803, 5809, 654718, 5805) (1414669, 428569, 654717, 5803, 5809, 654718, 5806) (1414673, 428585, 654764, 5868, 5875, 654765, 5869) (1414673, 428585, 654764, 5868, 5875, 654765, 5870) 736 results
query = '''
verse
clause
p1:phrase
=: b1:word
e1:word
:=
p2:phrase
=: b2:word
e2:word
:=
b1 < b2
e2 < e1
'''
qup(query)
QUERY= verse clause p1:phrase =: b1:word e1:word := p2:phrase =: b2:word e2:word := b1 < b2 e2 < e1 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 8 objects ... 0.31s Constraining search space with 13 relations ... 2.68s 9 edges thinned 2.68s Setting up retrieval plan with strategy small_choice_multi ... 2.76s Ready to deliver results from 1629290 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 2.76s STUDY DONE ... Search with 8 objects and 13 relations Results are instantiations of the following objects: node 0-verse 23207 choices node 1-clause 88071 choices node 2-phrase 253002 choices node 3-word 253002 choices node 4-word 253002 choices node 5-phrase 253002 choices node 6-word 253002 choices node 7-word 253002 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-verse 23207 choices edge 0-verse [[ 1-clause 3.6 choices (thinned) edge 1-clause [[ 5-phrase 2.7 choices (thinned) edge 5-phrase := 7-word 1.0 choices (thinned) edge 7-word ]] 5-phrase 0 choices edge 5-phrase [[ 6-word 1.0 choices (thinned) edge 5-phrase =: 6-word 0 choices edge 1-clause [[ 2-phrase 3.1 choices (thinned) edge 2-phrase [[ 4-word 1.0 choices edge 4-word := 2-phrase 0 choices edge 7-word < 4-word 0 choices edge 2-phrase [[ 3-word 1.0 choices (thinned) edge 2-phrase =: 3-word 0 choices edge 6-word > 3-word 0 choices 2.78s The results are connected to the original search template as follows: 0 1 R0 verse 2 R1 clause 3 4 R2 p1:phrase 5 R3 =: b1:word 6 R4 e1:word 7 := 8 9 R5 p2:phrase 10 R6 =: b2:word 11 R7 e2:word 12 := 13 14 15 b1 < b2 16 e2 < e1 17 2.83s FETCH ... 14267810 function calls (9509919 primitive calls) in 6.629 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 6.629 6.629 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.001 0.001 6.629 6.629 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 368 0.000 0.000 6.628 0.018 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 4758259/368 5.575 0.000 6.628 0.018 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 4753123 0.302 0.000 0.302 0.000 {built-in method builtins.len} 1378368 0.218 0.000 0.218 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:322(<lambda>) 543790 0.118 0.000 0.118 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:376(<lambda>) 834578 0.118 0.000 0.118 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:400(<lambda>) 834578 0.095 0.000 0.095 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:77(<lambda>) 253002 0.063 0.000 0.063 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:402(<lambda>) 364280 0.062 0.000 0.062 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:331(<lambda>) 253002 0.041 0.000 0.041 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:308(<lambda>) 290788 0.035 0.000 0.035 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:87(<lambda>) 3303 0.001 0.000 0.001 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 367 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 9.46s FETCH DONE ... (1414409, 427767, 652186, 1159, 1164, 652187, 1160, 1160) (1414437, 427889, 652543, 1720, 1723, 652544, 1721, 1721) (1414609, 428386, 654141, 4819, 4828, 654142, 4821, 4824) (1414669, 428569, 654717, 5803, 5809, 654718, 5805, 5806) (1414673, 428585, 654764, 5868, 5875, 654765, 5869, 5870) (1414706, 428692, 655100, 6515, 6530, 655101, 6521, 6521) (1414758, 428886, 655681, 7431, 7437, 655682, 7432, 7433) (1414760, 428890, 655697, 7466, 7475, 655698, 7467, 7468) (1414760, 428890, 655697, 7466, 7475, 655699, 7469, 7469) (1414815, 429127, 656391, 8502, 8520, 656392, 8507, 8507) 367 results
query = '''
sentence
phrase
=: b:word
e:word
:=
# phrase
=: x:word
b < x
x < e
'''
qup(query)
QUERY= sentence phrase =: b:word e:word := > phrase =: x:word b < x x < e 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 6 objects ... 0.24s Constraining search space with 11 relations ... 2.26s 3 edges thinned 2.26s Setting up retrieval plan with strategy small_choice_multi ... 2.35s Ready to deliver results from 1329762 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 2.35s STUDY DONE ... Search with 6 objects and 10 relations Results are instantiations of the following objects: node 0-sentence 63727 choices node 1-phrase 253207 choices node 2-word 253207 choices node 3-word 253207 choices node 4-phrase 253207 choices node 5-word 253207 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-sentence 63727 choices edge 0-sentence [[ 1-phrase 4.0 choices edge 1-phrase =: 2-word 1.0 choices (thinned) edge 1-phrase [[ 2-word 0 choices edge 1-phrase := 3-word 1.0 choices (thinned) edge 3-word ]] 1-phrase 0 choices edge 0-sentence [[ 4-phrase 4.1 choices edge 1-phrase > 4-phrase 0 choices edge 4-phrase [[ 5-word 1.0 choices edge 4-phrase =: 5-word 0 choices edge 3,2-word >,< 5-word 0 choices 2.36s The results are connected to the original search template as follows: 0 1 R0 sentence 2 R1 phrase 3 R2 =: b:word 4 R3 e:word 5 := 6 7 R4 > phrase 8 R5 =: x:word 9 10 b < x 11 x < e 12 2.37s FETCH ... 14279028 function calls (9717899 primitive calls) in 6.733 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 6.733 6.733 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.000 0.000 6.733 6.733 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 1 0.000 0.000 6.733 6.733 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 4561130/1 5.472 0.000 6.733 6.733 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 1444471 0.360 0.000 0.360 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:89(<lambda>) 4561132 0.288 0.000 0.288 0.000 {built-in method builtins.len} 848839 0.191 0.000 0.191 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:376(<lambda>) 848839 0.135 0.000 0.135 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:322(<lambda>) 595632 0.070 0.000 0.070 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:87(<lambda>) 595632 0.063 0.000 0.063 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:77(<lambda>) 253207 0.057 0.000 0.057 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:402(<lambda>) 316934 0.054 0.000 0.054 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:331(<lambda>) 253207 0.044 0.000 0.044 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:308(<lambda>) 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 9.10s FETCH DONE ... 0 results
S.study(query)
0.00s Checking search template ... 0.00s Setting up search space for 5 objects ... 0.23s Constraining search space with 8 relations ... 1.41s 2 edges thinned 1.42s Setting up retrieval plan with strategy small_choice_multi ... 1.46s Ready to deliver results from 1439412 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results
qup(query)
QUERY= verse clause p1:phrase =: w1:word w3:word := p2:phrase w2:word w1 < w2 w2 < w3 p1 < p2 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 7 objects ... 0.25s Constraining search space with 11 relations ... 2.14s 7 edges thinned 2.14s Setting up retrieval plan with strategy small_choice_multi ... 2.19s Ready to deliver results from 1549018 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 2.20s STUDY DONE ... Search with 7 objects and 11 relations Results are instantiations of the following objects: node 0-verse 23207 choices node 1-clause 88071 choices node 2-phrase 253002 choices node 3-word 253002 choices node 4-word 253002 choices node 5-phrase 253002 choices node 6-word 425732 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-verse 23207 choices edge 0-verse [[ 1-clause 4.2 choices (thinned) edge 1-clause [[ 5-phrase 2.9 choices (thinned) edge 5-phrase [[ 6-word 1.3 choices (thinned) edge 1-clause [[ 2-phrase 3.2 choices (thinned) edge 5-phrase > 2-phrase 0 choices edge 2-phrase [[ 4-word 1.0 choices edge 4-word := 2-phrase 0 choices edge 6-word < 4-word 0 choices edge 2-phrase [[ 3-word 1.0 choices (thinned) edge 2-phrase =: 3-word 0 choices edge 6-word > 3-word 0 choices 2.21s The results are connected to the original search template as follows: 0 1 R0 verse 2 R1 clause 3 4 R2 p1:phrase 5 R3 =: w1:word 6 R4 w3:word 7 := 8 9 R5 p2:phrase 10 R6 w2:word 11 12 w1 < w2 13 w2 < w3 14 15 p1 < p2 16 2.27s FETCH ... 12118991 function calls (8076141 primitive calls) in 5.908 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 5.908 5.908 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.001 0.001 5.908 5.908 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 737 0.000 0.000 5.907 0.008 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 4043587/737 4.865 0.000 5.907 0.008 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 1411533 0.373 0.000 0.373 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:89(<lambda>) 4034757 0.269 0.000 0.269 0.000 {built-in method builtins.len} 863581 0.143 0.000 0.143 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:322(<lambda>) 609843 0.099 0.000 0.099 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:400(<lambda>) 537010 0.091 0.000 0.091 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:331(<lambda>) 609843 0.065 0.000 0.065 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:77(<lambda>) 5888 0.001 0.000 0.001 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 736 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:376(<lambda>) 736 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects} 736 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:87(<lambda>) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 8.17s FETCH DONE ... (1414409, 427767, 652186, 1159, 1164, 652187, 1160) (1414437, 427889, 652543, 1720, 1723, 652544, 1721) (1414609, 428386, 654141, 4819, 4828, 654142, 4821) (1414609, 428386, 654141, 4819, 4828, 654142, 4822) (1414609, 428386, 654141, 4819, 4828, 654142, 4823) (1414609, 428386, 654141, 4819, 4828, 654142, 4824) (1414669, 428569, 654717, 5803, 5809, 654718, 5805) (1414669, 428569, 654717, 5803, 5809, 654718, 5806) (1414673, 428585, 654764, 5868, 5875, 654765, 5869) (1414673, 428585, 654764, 5868, 5875, 654765, 5870) 736 results
query = '''
w1:word
w2:word
w1 < w2
w1 <5: w2
w1 .lex. w2
'''
qup(query)
QUERY= w1:word w2:word w1 < w2 w1 <5: w2 w1 .lex. w2 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 2 objects ... 0.15s Constraining search space with 3 relations ... 0.19s 0 edges thinned 0.19s Setting up retrieval plan with strategy small_choice_multi ... 0.23s Ready to deliver results from 853168 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 0.23s STUDY DONE ... Search with 2 objects and 3 relations Results are instantiations of the following objects: node 0-word 426584 choices node 1-word 426584 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-word 426584 choices edge 0-word <5: 1-word 11.0 choices edge 0-word .lex. 1-word 0 choices edge 0-word < 1-word 0 choices 0.24s The results are connected to the original search template as follows: 0 1 R0 w1:word 2 R1 w2:word 3 4 w1 < w2 5 w1 <5: w2 6 w1 .lex. w2 7 0.24s FETCH ... 28378712 function calls (22275145 primitive calls) in 8.998 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 8.998 8.998 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.042 0.042 8.998 8.998 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 84977 0.017 0.000 8.939 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 6188544/84977 5.558 0.000 8.922 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 4692393 1.503 0.000 2.366 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:866(uu) 9384786 0.862 0.000 0.862 0.000 {method 'get' of 'dict' objects} 426584 0.330 0.000 0.535 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:728(<lambda>) 5848642 0.372 0.000 0.372 0.000 {built-in method builtins.len} 426584 0.119 0.000 0.119 0.000 {built-in method builtins.max} 426584 0.086 0.000 0.086 0.000 {built-in method builtins.min} 559710 0.064 0.000 0.064 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:77(<lambda>) 254928 0.036 0.000 0.036 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 84976 0.009 0.000 0.009 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 9.24s FETCH DONE ... (5, 9) (6, 10) (8, 12) (10, 13) (11, 14) (12, 17) (17, 19) (19, 24) (32, 37) (35, 38) 84976 results
query = '''
phrase
w1:word
w2:word
w1 < w2
w1 .lex. w2
'''
qup(query)
QUERY= phrase w1:word w2:word w1 < w2 w1 .lex. w2 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 3 objects ... 0.17s Constraining search space with 4 relations ... 1.19s 0 edges thinned 1.19s Setting up retrieval plan with strategy small_choice_multi ... 1.26s Ready to deliver results from 1106375 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 1.26s STUDY DONE ... Search with 3 objects and 4 relations Results are instantiations of the following objects: node 0-phrase 253207 choices node 1-word 426584 choices node 2-word 426584 choices Performance parameters: yarnRatio = 1.25 tryLimitFrom = 40 tryLimitTo = 40 Instantiations are computed along the following relations: node 0-phrase 253207 choices edge 0-phrase [[ 1-word 1.9 choices edge 0-phrase [[ 2-word 1.9 choices edge 1-word .lex. 2-word 0 choices edge 2-word > 1-word 0 choices 1.27s The results are connected to the original search template as follows: 0 1 R0 phrase 2 R1 w1:word 3 R2 w2:word 4 5 w1 < w2 6 w1 .lex. w2 7 1.27s FETCH ... 10681181 function calls (8003342 primitive calls) in 3.708 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 3.708 3.708 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.014 0.014 3.708 3.708 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 26068 0.006 0.000 3.689 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:683(deliver) 2703907/26068 2.625 0.000 3.684 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:690(stitchOn) 1362928 0.460 0.000 0.725 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:866(uu) 2725856 0.265 0.000 0.265 0.000 {method 'get' of 'dict' objects} 2573574 0.164 0.000 0.164 0.000 {built-in method builtins.len} 679791 0.109 0.000 0.109 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:322(<lambda>) 478718 0.048 0.000 0.048 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/relations.py:87(<lambda>) 104268 0.015 0.000 0.015 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:693(<genexpr>) 26067 0.003 0.000 0.003 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:684(<listcomp>) 4.98s FETCH DONE ... (651545, 5, 9) (651545, 6, 10) (651574, 51, 55) (651574, 52, 56) (651600, 92, 94) (651607, 103, 113) (651607, 104, 114) (651607, 105, 115) (651631, 144, 148) (651703, 247, 251) 26067 results
query = '''
phrase
/with/
word
< word
/-/
/without/
w1:word
< w2:word
w1 .lex#lex. w2
/-/
'''
qup(query)
QUERY= phrase /with/ word < word /-/ /without/ w1:word < w2:word w1 .lex#lex. w2 /-/ 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 1 objects ... | 0.00s "Quantifier on "parent:phrase" XXXX True False | | /with/ | | parent:phrase | | word | | < word | | 4.01s adding 78754 to 0 yields 78754 nodes | | /-/ | 4.01s reduction from 253207 to 78754 nodes | 0.00s "Quantifier on "parent:phrase" | | /without/ | | parent:phrase | | w1:word | | < w2:word | | w1 .lex#lex. w2 | | /-/ | | 4.30s 78606 nodes to exclude | 4.34s reduction from 78754 to 148 nodes 4.30s Constraining search space with 0 relations ... 4.30s 0 edges thinned 4.30s Setting up retrieval plan with strategy small_choice_multi ... 4.30s Ready to deliver results from 148 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 4.31s STUDY DONE ... Search with 1 objects and 0 relations Results are instantiations of the following objects: node 0-phrase 148 choices 4.31s The results are connected to the original search template as follows: 0 1 R0 phrase 2 /with/ 3 word 4 < word 5 /-/ 6 /without/ 7 w1:word 8 < w2:word 9 10 w1 .lex#lex. w2 11 /-/ 12 4.31s FETCH ... 448 function calls in 0.000 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 149 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:574(deliver) 148 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects} 148 0.000 0.000 0.000 0.000 {built-in method builtins.len} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 4.31s FETCH DONE ... (792085,) (863766,) (693784,) (822299,) (834079,) (880160,) (790561,) (819746,) (709154,) (820265,) 148 results
query = '''
phrase
/with/
word
< word
/-/
/without/
w1:word gn
< w2:word gn
w1 .gn#gn. w2
/-/
'''
qup(query)
QUERY= phrase /with/ word < word /-/ /without/ w1:word gn < w2:word gn w1 .gn#gn. w2 /-/ 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 1 objects ... | 0.00s "Quantifier on "parent:phrase" | | /with/ | | parent:phrase | | word | | < word | | 3.71s adding 78754 to 0 yields 78754 nodes | | /-/ | 3.71s reduction from 253207 to 78754 nodes | 0.00s "Quantifier on "parent:phrase" | | /without/ | | parent:phrase | | w1:word gn | | < w2:word gn | | w1 .gn#gn. w2 | | /-/ | | 4.70s 70216 nodes to exclude | 4.71s reduction from 78754 to 8538 nodes 4.67s Constraining search space with 0 relations ... 4.67s 0 edges thinned 4.67s Setting up retrieval plan with strategy small_choice_multi ... 4.67s Ready to deliver results from 8538 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 4.68s STUDY DONE ... Search with 1 objects and 0 relations Results are instantiations of the following objects: node 0-phrase 8538 choices 4.68s The results are connected to the original search template as follows: 0 1 R0 phrase 2 /with/ 3 word 4 < word 5 /-/ 6 /without/ 7 w1:word gn 8 < w2:word gn 9 10 w1 .gn#gn. w2 11 /-/ 12 4.68s FETCH ... 25618 function calls in 0.069 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 0.069 0.069 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.004 0.004 0.069 0.069 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 8539 0.064 0.000 0.064 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:574(deliver) 8538 0.001 0.000 0.001 0.000 {built-in method builtins.len} 8538 0.001 0.000 0.001 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 4.75s FETCH DONE ... (688130,) (819204,) (819207,) (655370,) (786443,) (819213,) (655377,) (786450,) (851992,) (819225,) 8538 results
query = '''
phrase
/with/
w1:word gn
< w2:word gn
w1 .gn#gn. w2
/-/
/without/
w1:word
< w2:word
w1 .lex#lex. w2
/-/
'''
qup(query)
QUERY= phrase /with/ w1:word gn < w2:word gn w1 .gn#gn. w2 /-/ /without/ w1:word < w2:word w1 .lex#lex. w2 /-/ 0.00s STUDY ... 0.00s Checking search template ... 0.00s Setting up search space for 1 objects ... | 0.00s "Quantifier on "parent:phrase" | | /with/ | | parent:phrase | | w1:word gn | | < w2:word gn | | w1 .gn#gn. w2 | | 4.81s adding 70216 to 0 yields 70216 nodes | | /-/ | 4.81s reduction from 253207 to 70216 nodes | 0.00s "Quantifier on "parent:phrase" | | /without/ | | parent:phrase | | w1:word | | < w2:word | | w1 .lex#lex. w2 | | /-/ | | 4.18s 78606 nodes to exclude | 4.21s reduction from 70216 to 1 nodes 4.18s Constraining search space with 0 relations ... 4.18s 0 edges thinned 4.18s Setting up retrieval plan with strategy small_choice_multi ... 4.18s Ready to deliver results from 1 nodes Iterate over S.fetch() to get the results See S.showPlan() to interpret the results 4.19s STUDY DONE ... Search with 1 objects and 0 relations Results are instantiations of the following objects: node 0-phrase 1 choices 4.19s The results are connected to the original search template as follows: 0 1 R0 phrase 2 /with/ 3 w1:word gn 4 < w2:word gn 5 w1 .gn#gn. w2 6 /-/ 7 8 /without/ 9 w1:word 10 < w2:word 11 w1 .lex#lex. w2 12 /-/ 13 4.19s FETCH ... 7 function calls in 0.000 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/search.py:151(fetch) 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/searchexe.py:89(fetch) 1 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects} 1 0.000 0.000 0.000 0.000 {built-in method builtins.len} 2 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/search/stitch.py:574(deliver) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 4.19s FETCH DONE ... (879226,) 1 results
A.displaySetup(extraFeatures='gn')
A.pretty(879226, withNodes=True)
levUpObj = TF.features['__levUp__']
levUpObj
<tf.core.data.Data at 0x7fee19caddd8>
prof(levUpObj.load, {}, {})
| | 19s C __levUp__ from otype, oslots, __rank__ 34988739 function calls (34988712 primitive calls) in 18.567 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 4/1 0.000 0.000 18.567 18.567 /Users/dirk/github/annotation/text-fabric/tf/core/data.py:61(load) 1 0.350 0.350 15.876 15.876 /Users/dirk/github/annotation/text-fabric/tf/core/data.py:356(_compute) 1 5.805 5.805 15.526 15.526 /Users/dirk/github/annotation/text-fabric/tf/core/prepare.py:88(levUp) 1446799 2.251 0.000 3.981 0.000 {built-in method builtins.sorted} 1020215 1.015 0.000 3.104 0.000 {built-in method _functools.reduce} 1 0.000 0.000 2.690 2.690 /Users/dirk/github/annotation/text-fabric/tf/core/data.py:530(_writeDataBin) 1 2.038 2.038 2.689 2.689 {built-in method _pickle.dump} 3834183 2.089 0.000 2.089 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/prepare.py:114(<lambda>) 8754102 1.129 0.000 1.129 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/prepare.py:122(<lambda>) 1020215 0.799 0.000 0.799 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/prepare.py:121(<listcomp>) 1163 0.005 0.000 0.651 0.001 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/gzip.py:247(write) 1163 0.617 0.001 0.617 0.001 {method 'compress' of 'zlib.Compress' objects} 4854398 0.601 0.000 0.601 0.000 {method 'add' of 'set' objects} 4854404 0.601 0.000 0.601 0.000 {method 'setdefault' of 'dict' objects} 4854398 0.601 0.000 0.601 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/prepare.py:104(<lambda>) 426584 0.343 0.000 0.343 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/prepare.py:103(<listcomp>) 2893604 0.191 0.000 0.191 0.000 {method 'append' of 'list' objects} 1021385 0.100 0.000 0.100 0.000 {built-in method builtins.len} 1173 0.023 0.000 0.023 0.000 {method 'write' of '_io.BufferedWriter' objects} 1164 0.005 0.000 0.005 0.000 {built-in method zlib.crc32} 1163 0.001 0.000 0.001 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_compression.py:12(_check_not_closed) 6 0.000 0.000 0.001 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/timestamp.py:55(info) 6 0.000 0.000 0.001 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/timestamp.py:15(raw_msg) 1 0.000 0.000 0.001 0.001 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ipykernel/iostream.py:334(flush) 1 0.000 0.000 0.001 0.001 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py:534(wait) 1 0.000 0.000 0.001 0.001 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/gzip.py:302(close) 1 0.000 0.000 0.001 0.001 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py:264(wait) 9 0.000 0.000 0.000 0.000 {method 'acquire' of '_thread.lock' objects} 1165 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/gzip.py:298(closed) 27/8 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/data.py:550(_getModified) 40 0.000 0.000 0.000 0.000 {built-in method posix.stat} 21 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/genericpath.py:16(exists) 7/2 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/data.py:555(<listcomp>) 1167 0.000 0.000 0.000 0.000 {built-in method builtins.isinstance} 1 0.000 0.000 0.000 0.000 {method 'flush' of 'zlib.Compress' objects} 1 0.000 0.000 0.000 0.000 {method 'close' of '_io.BufferedWriter' objects} 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/gzip.py:20(open) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/gzip.py:123(__init__) 1 0.000 0.000 0.000 0.000 {built-in method io.open} 19 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/genericpath.py:53(getmtime) 4 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ipykernel/iostream.py:195(schedule) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ipykernel/iostream.py:382(write) 6 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/timestamp.py:86(_elapsed) 2 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/data.py:367(info) 4 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/zmq/sugar/socket.py:334(send) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/gzip.py:221(_write_gzip_header) 5 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py:1080(is_alive) 7 0.000 0.000 0.000 0.000 {method 'format' of 'str' objects} 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py:499(__init__) 5 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/timestamp.py:66(indent) 3 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/gzip.py:64(write32u) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ipykernel/iostream.py:320(_schedule_flush) 5 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py:1038(_wait_for_tstate_lock) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py:216(__init__) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/gzip.py:213(_init_write) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/posixpath.py:144(basename) 7 0.000 0.000 0.000 0.000 {method 'replace' of 'str' objects} 2 0.000 0.000 0.000 0.000 {method 'join' of 'str' objects} 1 0.000 0.000 0.000 0.000 {built-in method zlib.compressobj} 7 0.000 0.000 0.000 0.000 {built-in method builtins.max} 20 0.000 0.000 0.000 0.000 {built-in method time.time} 7 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/data.py:556(<listcomp>) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py:243(__exit__) 1 0.000 0.000 0.000 0.000 {built-in method builtins.round} 3 0.000 0.000 0.000 0.000 {built-in method _struct.pack} 4 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ipykernel/iostream.py:93(_event_pipe) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ipykernel/iostream.py:307(_is_master_process) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py:252(_acquire_restore) 2 0.000 0.000 0.000 0.000 {method 'encode' of 'str' objects} 2 0.000 0.000 0.000 0.000 {built-in method _thread.allocate_lock} 7 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/data.py:69(<genexpr>) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/posixpath.py:41(_get_sep) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py:240(__enter__) 1 0.000 0.000 0.000 0.000 {method 'endswith' of 'bytes' objects} 1 0.000 0.000 0.000 0.000 {method 'rfind' of 'str' objects} 2 0.000 0.000 0.000 0.000 {method 'startswith' of 'str' objects} 1 0.000 0.000 0.000 0.000 {built-in method builtins.chr} 1 0.000 0.000 0.000 0.000 {built-in method posix.getpid} 2 0.000 0.000 0.000 0.000 {built-in method posix.fspath} 5 0.000 0.000 0.000 0.000 {method 'append' of 'collections.deque' objects} 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} 1 0.000 0.000 0.000 0.000 /Users/dirk/github/annotation/text-fabric/tf/core/data.py:378(<listcomp>) 5 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py:507(is_set) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py:249(_release_save) 1 0.000 0.000 0.000 0.000 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py:255(_is_owned) 1 0.000 0.000 0.000 0.000 {built-in method _imp.lock_held} 1 0.000 0.000 0.000 0.000 {method 'release' of '_thread.lock' objects} 1 0.000 0.000 0.000 0.000 {method '__enter__' of '_thread.lock' objects} 1 0.000 0.000 0.000 0.000 {method '__exit__' of '_thread.lock' objects}
True
levUpObj.dataLoaded = False