This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Transcoding between beta- and uni-code you can easily be done in the following manner: | |
```python | |
import beta_code | |
beta_code.greek_to_beta_code(u'χαῖρε ὦ κόσμε') | |
'xai=re w)= ko/sme' | |
beta_code.beta_code_to_greek('xai=re w)= ko/sme') | |
'χαῖρε ὦ κόσμε' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Loading the Text-Fabric code | |
from tf.fabric import Fabric | |
from tf.app import use | |
# load the app and data and the BHSaddons features | |
BHSA = use ("etcbc/BHSA", mod="tonyjurg/BHSaddons/tf/", hoist=globals()) | |
# find all verse nodes for this parasha using its sequence number | |
parashaQuery = ''' | |
verse parashanum=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code traverses the hierarchical structure of a Text-Fabric corpus, | |
# starting from books and drilling down through chapters, verses, and words. | |
# At each level, it allows for processing or extracting specific data | |
# related to the respective nodes (book, chapter, verse, or word). | |
# Loop through all the book nodes in the corpus | |
for bookNode in F.otype.s('book'): | |
# Do something on the book nodes data | |
# Loop through all the chapter nodes in the book |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The Greek words in the New Testament are classified semantically according to a two-tier system developed by Louw and Nida. | |
# This Python script maps the top-level codes (the part of the Louw-Nida code preceding the dot) to their human-readable descriptions. | |
# The structure of the dictionary is: | |
# louwNidaMapping = { | |
# numeric (key): "description" | |
# ... | |
# } | |
# The information for this dictionary is obtained from parsing the Louw-Nida Lexicon information available at laparola.net. | |
# The original publication is by Johannes P. Louw and Eugene Albert Nida, titled: | |
# Greek-English Lexicon of the New Testament: Based on Semantic Domains (New York: United Bible Societies, 1996). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SHEBANQ REST API - https://github.com/ETCBC/shebanq/wiki/REST-Api | |
# https://github.com/ETCBC/shebanq/wiki/REST-Api#deep-linking-to-shebanq | |
# Define the transliteration substitution function | |
def substituteTranslit(translit): | |
substitutions = { | |
'>': 'A', # aleph | |
'<': 'O', # ayin | |
'/': 'n', # nun | |
'[': 'v', # vav |