-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[prakriya] Add sutras for all source types
Not all files are complete, but this provides adequate coverage for now.
- Loading branch information
Showing
30 changed files
with
463 additions
and
68 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import csv | ||
import json | ||
import urllib.request | ||
from vidyut.lipi import transliterate, Scheme | ||
|
||
PHIT = "https://raw.githubusercontent.com/ashtadhyayi-com/data/refs/heads/master/fit/data.txt" | ||
LINGA = "https://raw.githubusercontent.com/ashtadhyayi-com/data/refs/heads/master/linganushasanam/data.txt" | ||
|
||
|
||
def process_phits(): | ||
f = urllib.request.urlopen(PHIT) | ||
data = json.load(f) | ||
|
||
rows = [] | ||
for row in data["data"]: | ||
pada = row["p"] | ||
number = row["n"] | ||
|
||
code = f"{pada}.{number}" | ||
text = transliterate(row["s"], Scheme.Devanagari, Scheme.Slp1) | ||
text = text.strip() | ||
rows.append((code, text)) | ||
|
||
out_file = "../../vidyut-prakriya/data/phit-sutras.tsv" | ||
with open(out_file, 'w') as f: | ||
w = csv.writer(f, delimiter="\t") | ||
w.writerow(["code", "text"]) | ||
for row in rows: | ||
w.writerow(row) | ||
|
||
|
||
def process_lingas(): | ||
f = urllib.request.urlopen(LINGA) | ||
data = json.load(f) | ||
|
||
rows = [] | ||
for row in data["data"]: | ||
code = str(row["id"]) | ||
text = transliterate(row["sutra"], Scheme.Devanagari, Scheme.Slp1) | ||
text = text.strip() | ||
rows.append((code, text)) | ||
|
||
out_file = "../../vidyut-prakriya/data/linganushasanam.tsv" | ||
with open(out_file, 'w') as f: | ||
w = csv.writer(f, delimiter="\t") | ||
w.writerow(["code", "text"]) | ||
for row in rows: | ||
w.writerow(row) | ||
|
||
process_phits() | ||
process_lingas() |
This file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
code text | ||
01.0933 GawAdayo mitaH | ||
01.0934 janIjFzkanasuraYjo'mantASca | ||
01.0935 jvalahvalahmalanamAmanupasargAdvA | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
code text | ||
3.2.93 karmaRIti vartamAne punaH karmagrahaRaM kartuH kutsAnimitte karmaRi yaTA syAt, karmamAtre mA BUt | ||
3.2.138 cakAro'nuktasamuccayArTaH | ||
4.4.13 krayavikrayagrahaRaM saMGAtavigfhItArTam | ||
4.4.101 Rapratyayo'pyatrezyate | ||
6.1.3 kecidAhurvyaYjanasyeti | ||
6.1.64 zWivu ityasya dvitIyasTakArazWakAraScezyate | ||
7.2.16 cakAro'nuktasamuccayArTaH | ||
7.3.78 sartervegitAyAM gatO DAvAdeSamicCanti | ||
7.4.71 fkArEkadeSo rePo halgrahaRena gfhyate |
Oops, something went wrong.