#!/usr/bin/env python # coding: utf-8 # # Local Play Ground # Setting up the file location structure of the playground. # See image: # # # Note that the variable `version` is defined as: # > The version directory with the actual `tf` files that will be used. # In[1]: get_ipython().run_line_magic('load_ext', 'autoreload') get_ipython().run_line_magic('autoreload', '2') # In[2]: from tf.app import use # In[152]: # load the N1904 app and data from GitHub PLAY = use ("tonyjurg/Nestle1904LFT", version="0.6", hoist=globals()) # In[133]: # load the N1904 app and data from local disc PLAY = use("app:/TF/app", hoist=globals()) # In[153]: # Set default view in a way to limit noise as much as possible. PLAY.displaySetup(condensed=True, multiFeatures=False,queryFeatures=False) # In[154]: SentenceQuery = ''' sentence headverse=1 book=John chapter=1 ''' SentenceResults = PLAY.search(SentenceQuery) # In[155]: PLAY.show(SentenceResults) # In[156]: print (SentenceResults) # In[157]: PLAY.table(SentenceResults) # In[158]: Query = ''' book book=Matthew verse chapter=1 verse=1 ''' Results = PLAY.search(Query) # In[159]: FeatureList=Fall() LinesToPrint=5 for Feature in FeatureList: if Feature!='otype': print ('Feature:',Feature,'\n\n\t value\t frequency') FeatureFrequenceLists=Fs(Feature).freqList() PrintedLine=0 for item, freq in FeatureFrequenceLists: PrintedLine+=1 print ('\t',item,'\t',freq) if PrintedLine==LinesToPrint: break print ('\n') # In[ ]: