API reference
This page defines an API reference for the vidyut package.
The tools we used to generate this page are optimized for pure Python modules. But since this package is not pure Python, these tools occasionally have issues when processing our code. Known issues:
Enum members don’t have docstrings.
Special methods (__new__, …) don’t have docstrings.
Function docs don’t have argument types or return types.
Properties and attributes don’t have types.
We will fix these issues as soon as we can. In the meantime, please refer to the extensive examples elsewhere in the docs.
vidyut.cheda
vidyut.cheda segments and tags Sanskrit expressions.
vidyut.chandas
vidyut.chandas analyzes Sanskrit meters.
- class vidyut.chandas.Akshara
A Sanskrit syllable.
An akshara follows the following rules:
It must contain exactly one vowel.
It must end with a vowel, an anusvara, or a visarga.
It must not start with an anusvara or visarga.
Together, these three rurles mean that an input string has exactly one division into aksharas.
- class vidyut.chandas.Chandas
A metrical classifier.
- classify(text)
Classify the input string against an internal list of meters.
text should be an SLP1 string.
- static from_text(text)
Initialize Chandas from the input string.
text should be a TSV with three columns:
The meter name.
The meter type, e.g. vrtta (Currently unused)
A string containing the characters G, L, /, and |, where G is guru, L is laghu, / marks a pada boundary, and | marks yati.
- jatis
Return all jatis defined on this classifier.
- vrttas
Return all vrttas defined on this classifier.
- class vidyut.chandas.Jati
Models a jāti, which defines a specific pattern of *mātrā*s (morae).
- matras()
The matras that constitute this jati.
- class vidyut.chandas.Match
Models a match against our database or meters.
vidyut.kosha
- class vidyut.kosha.Kosha
A compact Sanskrit kosha.
- __contains__(key, /)
Return key in self.
- __new__(**kwargs)
- dhatus()
Return an iterator over all dhatus in the kosha.
This method is inefficient because it creates a copy of the kosha’s internal dhatu list. But since the dhatu list contains ~40,000 entries, this is not very slow in practice.
- get(key)
Return all entries with the given key.
- pratipadikas()
Return an iterator over all pratipadikas in the kosha.
This method is inefficient because it creates a copy of the kosha’s internal pratipadika list. The pratipadika list contains more than a million entries in our official data release, so this method may be slow on some machines.
Return types
- class vidyut.kosha.PadaEntry
An entry in the kosha.
A PadaEntry is a simple dataclass that models either a Subanta or a Tinanta. These types are constructed by Kosha directly, and we strongly encourage you to avoid creating these types for yourself unless you are creating a Kosha for yourself.
The PadaEntry.Subanta constructor creates a subanta:
from vidyut.kosha import PratipadikaEntry, PadaEntry from vidyut.prakriya import Pratipadika, Linga, Vibhakti, Vacana rama = Pratipadika.basic("rAma") rama_entry = PratipadikaEntry.Basic(pratipadika=rama, lingas=[Linga.Pum]) pada = PadaEntry.Subanta( pratipadika_entry=rama_entry, linga=Linga.Pum, vibhakti=Vibhakti.Prathama, vacana=Vacana.Eka) assert pada.lemma == "rAma"
PadaEntry.Subanta can also create an avyaya:
from vidyut.kosha import PratipadikaEntry, PadaEntry from vidyut.prakriya import Pratipadika ca = Pratipadika.basic("ca", is_avyaya=True) ca_entry = PratipadikaEntry.Basic(pratipadika=ca, lingas=[]) pada = PadaEntry.Subanta(pratipadika_entry=ca_entry) assert pada.lemma == "ca" assert pada.is_avyaya
The PadaEntry.Tinanta constructor creates a tinanta:
from vidyut.kosha import DhatuEntry, PadaEntry from vidyut.prakriya import Dhatu, Prayoga, Lakara, Purusha, Vacana, Gana gam = Dhatu.mula("ga\\mx~", Gana.Bhvadi) gam_entry = DhatuEntry(dhatu=gam, clean_text="gam") pada = PadaEntry.Tinanta( dhatu_entry=gam_entry, prayoga=Prayoga.Kartari, lakara=Lakara.Lat, purusha=Purusha.Prathama, vacana=Vacana.Eka) assert pada.lemma == "gam"
- lemma
The lemma used by this pada.
The lemma is either a dhātu or a simple prātipadika.
- class vidyut.kosha.DhatuEntry
A verb root.
- artha_en
- artha_hi
- artha_sa
The meaning of this dhatu’s mūla as an SLP1 string.
We have meaning strings only for the ~2000 mūla dhatus from the Dhatupatha. Any roots derived from these ~2000 will share their artha with the dhatu they come from.
Examples:
BU –> sattAyAm
aBiBU –> sattAyAm
aBibuBUza –> sattAyAm
- clean_text
The human-readable text representation of this dhatu.
Examples:
qukf\Y –> kf
vidi~ –> vind
- dhatu
- ittva
- karmatva
- pada
- class vidyut.kosha.PratipadikaEntry
A prātipadika with its metadata.
- Basic
alias of
PyPratipadikaEntry_Basic
- Krdanta
alias of
PyPratipadikaEntry_Krdanta
- is_avyaya
- lemma
The lemma that corresponds to this prātipadika.
The lemma is either a dhātu or a simple prātipadika.
- lingas
Returns the lingas that this prātipadika is allowed to use.
If empty, lingas might not yet be implemented for this prātipadika type.
- to_prakriya_args()
Convert this entry to a
Pratipadika.
Builder API
- class vidyut.kosha.Builder
Builder for a Kosha.
Memory usage is linear in the number of unique lemmas.
- finish()
Complete the build process.
If this method is not called, the output data will be invalid.
- insert(key, pada)
Insert the given (key, pada) pair.
Keys must be inserted in lexicographic order. If a key is received out of order, this method will raise an OSError.
vidyut.lipi
vidyut.lipi transliterates scripts used within the Indosphere.
- class vidyut.lipi.Scheme
A method of encoding text.
Schemes vary on various dimensions, including:
writing system (alphabet vs. abugida)
text encoding (ASCII vs. Unicode)
support for Sanskrit (complete vs. partial)
- static choices()
Returns all options for this enum.
- static from_string(val)
Create an enum value from the given string.
This is the inverse of __str__.
- icu_numeric_code
The scheme’s ICU code, if one exists.
ICU codes are defined in conformance with the values in the ICU4X Script impl [here][1].
- iso_15924_code
The scheme’s ISO 15924 four-letter code, if one exists.
- iso_15924_numeric_code
The scheme’s ISO 15924 numeric code, if one exists.
- name
The name used to define the Enum member.
(Defined for compatibility with Python enums.)
- vidyut.lipi.detect(input_text)
Return the scheme used by input_text, or
Noneif the scheme could not be decided.detect analyzes the input string by applying various heuristic tests. For non-ASCII scripts, detect checks whether characters are in a specific unicode range. For ASCII scripts, detect checks for bigrams and trigrams associated with specific encodings. (For example, R^i is indicative of ITRANS.) Currently, detect returns the first match found and does not do any kind of scoring, ranking, statistical modeling, etc.
detect is ideal for interfaces where the user would otherwise need to manually choose which input encoding to use. detect removes some of this user friction by making a reasonable guess about the user’s query.
detect is best used on text that is mostly or entirely in one Scheme. For text that uses multiple schemes, we recommend splitting the text into smaller chunks and running detect on these chunks individually. For greater accuracy, we recommend using a more sophisticated approach than this function provides.
vidyut.prakriya
The members here are documented in four sections:
Main types specifies our high-level API.
Disk types specifies the types used to read data from external files.
Input types specifies the types passed into our API.
Output types specifies the types returned by our API.
Main types
- class vidyut.prakriya.Vyakarana
An interface to the rules of the Ashtadhyayi.
Options:
log_steps (default:
True) – If set, log each step in the prakriya. Disable this if you want extra speed.is_chandasi (default:
False) – If set, use rules tagged with chandasi, mantre, etc.use_svaras (default:
False) – If set, use rules that add svaras to the output.nlp_mode (default:
False) – If set, preserve the final s/r of words. This behavior is useful for certain applications in natural language processing.
Disk types
- class vidyut.prakriya.Data
Provides an interface to various data files.
- load_dhatu_entries()
Return all entries defined in the Dhatupatha.
- load_sutras()
Return all sutras used as rules.
Sutras come from various sources, including:
the gana-sutras in the Dhatupatha
the Ashtadhyayi
the Unadipatha
various varttikas
- class vidyut.prakriya.DhatupathaEntry
An entry in the Dhatupatha.
- artha
The meaning of this dhatu.
- code
The numeric code associated with this dhatu.
If you are using the linguistic data that comes with Vidyut, this code is consistent with the codes used by ashtadhyayi.com.
- dhatu
The dhatu itself.
- class vidyut.prakriya.Sutra
A sutra from the Ashtadhyayi or a related text.
Example:
s = Sutra(source=Source.Ashtadhyayi, code='1.1.1', text='vfdDirAdEc')
- code
The code that represents this sutra.
- source
The source text that this sutra comes from.
- text
The text of this sutra. All sutra text is in the SLP1 encoding scheme.
Input types
Names of suffixes, including the members of Krt, Sanadi, and Taddhita, are written in the SLP1 encoding scheme.
- class vidyut.prakriya.Dhatu
A verb root.
- antargana
The antargana that this dhatu belongs to.
- anubandhas()
- aupadeshika
The aupadeshika form of this dhatu.
- gana
The gana that this dhatu belongs to.
- static mula(aupadeshika, gana, *, antargana=None, prefixes=None, sanadi=None)
Creates a new mula-dhatu.
aupadeshika should be an SLP1 string and include anudatta and svarita accents as necessary. For examples, see the dhatus in dhatupatha.tsv. (If you don’t have this file, consult the rest of our documentation for information on where to find it.)
- static nama(pratipadika, *, nama_sanadi=None)
Creates a new namadhatu with its sanadi pratyaya.
If nama_sanadi is None, the program will try finding a sanadi match by appling the rules in pada 3.1 of the Ashtadhyayi. If no match is found, the prakriya will abort.
- prefixes
The prefixes that this dhatu uses.
- sanadi
The sanadi pratyayas that this dhatu uses.
- with_prefixes(prefixes)
Shorthand for modifying an existing dhatu with new prefixes.
- with_sanadi(sanadi)
Shorthand for modifying an existing dhatu with new sanadis.
- class vidyut.prakriya.Pratipadika
A nominal stem.
- static basic(text, is_avyaya=False)
Create a new pratipadika that is a simple base.
text should be an SLP1 string.
- is_avyaya
Whether or not this pratipadika represents an avyaya.
- is_nyap
Whether or not this pratipadika should be treated as a nyAp-anta.
- static krdanta(dhatu, krt, prayoga=Ellipsis, lakara=Ellipsis)
Create a new pratipadika that is a krdanta.
- static nyap(text)
Create a new pratipadika that is treated as ending in a nyAp-pratyaya.
text should be an SLP1 string.
- static taddhitanta(pratipadika, taddhita)
Create a new pratipadika that is a taddhitanta.
- text
The text of this stem.
- class vidyut.prakriya.Antargana
A dhatu’s gaṇa or minor category.
- Adhrshiya = Antargana.Adhrshiya
- Akusmiya = Antargana.Akusmiya
- Asvadiya = Antargana.Asvadiya
- Ghatadi = Antargana.Ghatadi
- Kutadi = Antargana.Kutadi
- static choices()
Return all possible values for this enum.
- static from_string(val)
DEPRECATED – prefer __new__ instead.
Create an enum value from the given string.
This is the inverse of __str__. Performance is currently linear in the number of enum options.
- name
The name used to define the Enum member.
- value
The name used to define the Enum member.
The returned value is guaranteed to be identical to the output of __str__.
- class vidyut.prakriya.Gana
A dhatu’s gaṇa or major category.
- Adadi = Gana.Adadi
- Bhvadi = Gana.Bhvadi
- Curadi = Gana.Curadi
- Divadi = Gana.Divadi
- Juhotyadi = Gana.Juhotyadi
- Kandvadi = Gana.Kandvadi
- Kryadi = Gana.Kryadi
- Rudhadi = Gana.Rudhadi
- Svadi = Gana.Svadi
- Tanadi = Gana.Tanadi
- Tudadi = Gana.Tudadi
- static choices()
Return all possible values for this enum.
- static from_string(val)
DEPRECATED – prefer __new__ instead.
Create an enum value from the given string.
This is the inverse of __str__. Performance is currently linear in the number of enum options.
- name
The name used to define the Enum member.
- value
The name used to define the Enum member.
The returned value is guaranteed to be identical to the output of __str__.
- class vidyut.prakriya.Krt
The complete list of ordinary kṛt pratyayas.
Each pratyaya name is written in the SLP1 encoding scheme.
- Aluc = Krt.Aluc
- Aru = Krt.Aru
- Ga = Krt.Ga
- GaY = Krt.GaY
- GinuR = Krt.GinuR
- Gurac = Krt.Gurac
- KaS = Krt.KaS
- Kac = Krt.Kac
- Kal = Krt.Kal
- KizRuc = Krt.KizRuc
- KukaY = Krt.KukaY
- Kyun = Krt.Kyun
- Nvanip = Krt.Nvanip
- Ra = Krt.Ra
- Ramul = Krt.Ramul
- Rini = Krt.Rini
- Rvi = Krt.Rvi
- Rvuc = Krt.Rvuc
- Rvul = Krt.Rvul
- Ryat = Krt.Ryat
- Ryuw = Krt.Ryuw
- SAnac = Krt.SAnac
- SAnan = Krt.SAnan
- Sa = Krt.Sa
- SaDyE = Krt.SaDyE
- SaDyEn = Krt.SaDyEn
- Satf = Krt.Satf
- Takan = Krt.Takan
- Uka = Krt.Uka
- Yyuw = Krt.Yyuw
- a = Krt.a
- aDyE = Krt.aDyE
- aDyEn = Krt.aDyEn
- aN = Krt.aN
- aR = Krt.aR
- aTuc = Krt.aTuc
- ac = Krt.ac
- anIyar = Krt.anIyar
- ani = Krt.ani
- anubandhas()
- ap = Krt.ap
- ase = Krt.ase
- asen = Krt.asen
- atfn = Krt.atfn
- cAnaS = Krt.cAnaS
- static choices()
Return all possible values for this enum.
- drshya()
- static from_string(val)
DEPRECATED – prefer __new__ instead.
Create an enum value from the given string.
This is the inverse of __str__. Performance is currently linear in the number of enum options.
- iY = Krt.iY
- ika = Krt.ika
- ikavaka = Krt.ikavaka
- in_ = Krt.in_
- ini = Krt.ini
- itra = Krt.itra
- izRuc = Krt.izRuc
- kAnac = Krt.kAnac
- ka = Krt.ka
- kaDyE = Krt.kaDyE
- kaDyEn = Krt.kaDyEn
- kaY = Krt.kaY
- kamul = Krt.kamul
- kap = Krt.kap
- kase = Krt.kase
- kasen = Krt.kasen
- kasun = Krt.kasun
- kelimar = Krt.kelimar
- ki = Krt.ki
- kin = Krt.kin
- klukan = Krt.klukan
- kmarac = Krt.kmarac
- knu = Krt.knu
- kru = Krt.kru
- krukan = Krt.krukan
- ksnu = Krt.ksnu
- kta = Krt.kta
- ktavatu = Krt.ktavatu
- ktic = Krt.ktic
- ktin = Krt.ktin
- ktri = Krt.ktri
- ktvA = Krt.ktvA
- kurac = Krt.kurac
- kvanip = Krt.kvanip
- kvarap = Krt.kvarap
- kvasu = Krt.kvasu
- kvin = Krt.kvin
- kvip = Krt.kvip
- kyap = Krt.kyap
- lyu = Krt.lyu
- lyuw = Krt.lyuw
- manin = Krt.manin
- naN = Krt.naN
- najiN = Krt.najiN
- name
The name used to define the Enum member.
- nan = Krt.nan
- ni = Krt.ni
- qa = Krt.qa
- qara = Krt.qara
- qu = Krt.qu
- ra = Krt.ra
- ru = Krt.ru
- se = Krt.se
- sen = Krt.sen
- tavE = Krt.tavE
- taveN = Krt.taveN
- taven = Krt.taven
- tavya = Krt.tavya
- tavyat = Krt.tavyat
- tfc = Krt.tfc
- tfn = Krt.tfn
- tosun = Krt.tosun
- tumun = Krt.tumun
- u = Krt.u
- ukaY = Krt.ukaY
- value
The name used to define the Enum member.
The returned value is guaranteed to be identical to the output of __str__.
- vanip = Krt.vanip
- varac = Krt.varac
- vic = Krt.vic
- viw = Krt.viw
- vuY = Krt.vuY
- vun = Krt.vun
- wa = Krt.wa
- wak = Krt.wak
- ya = Krt.ya
- yat = Krt.yat
- yuc = Krt.yuc
- zAkan = Krt.zAkan
- zvun = Krt.zvun
- zwran = Krt.zwran
- class vidyut.prakriya.Lakara
The lakara to use in the derivation.
- AshirLin = Lakara.AshirLin
- Lan = Lakara.Lan
- Lat = Lakara.Lat
- Let = Lakara.Let
- Lit = Lakara.Lit
- Lot = Lakara.Lot
- Lrn = Lakara.Lrn
- Lrt = Lakara.Lrt
- Lun = Lakara.Lun
- Lut = Lakara.Lut
- VidhiLin = Lakara.VidhiLin
- static choices()
Return all possible values for this enum.
- static from_string(val)
DEPRECATED – prefer __new__ instead.
Create an enum value from the given string.
This is the inverse of __str__. Performance is currently linear in the number of enum options.
- name
The name used to define the Enum member.
- value
The name used to define the Enum member.
The returned value is guaranteed to be identical to the output of __str__.
- class vidyut.prakriya.Linga
The linga to use in the derivation.
- Napumsaka = Linga.Napumsaka
- Pum = Linga.Pum
- Stri = Linga.Stri
- static choices()
Return all possible values for this enum.
- static from_string(val)
DEPRECATED – prefer __new__ instead.
Create an enum value from the given string.
This is the inverse of __str__. Performance is currently linear in the number of enum options.
- name
The name used to define the Enum member.
- value
The name used to define the Enum member.
The returned value is guaranteed to be identical to the output of __str__.
- class vidyut.prakriya.Pada
A Sanskrit pada.
Notes for Pada.Tinanta:
If skip_at_agama is
Trueand the lakara is Lun, Lan, or Lrn, then the derivation will not add the aṭ/āṭ āgama to the verb. This is to derive forms like gamat, karot, etc.
- Subanta
alias of
PyPada_Subanta
- Tinanta
alias of
PyPada_Tinanta
- static make_avyaya(pratipadika)
- class vidyut.prakriya.Prayoga
The prayoga of some tinanta.
- Bhave = Prayoga.Bhave
- Karmani = Prayoga.Karmani
- Kartari = Prayoga.Kartari
- static choices()
Return all possible values for this enum.
- static from_string(val)
DEPRECATED – prefer __new__ instead.
Create an enum value from the given string.
This is the inverse of __str__. Performance is currently linear in the number of enum options.
- name
The name used to define the Enum member.
- value
The name used to define the Enum member.
The returned value is guaranteed to be identical to the output of __str__.
- class vidyut.prakriya.Purusha
The person of some tinanta.
- Madhyama = Purusha.Madhyama
- Prathama = Purusha.Prathama
- Uttama = Purusha.Uttama
- static choices()
Return all possible values for this enum.
- static from_string(val)
DEPRECATED – prefer __new__ instead.
Create an enum value from the given string.
This is the inverse of __str__. Performance is currently linear in the number of enum options.
- name
The name used to define the Enum member.
- value
The name used to define the Enum member.
The returned value is guaranteed to be identical to the output of __str__.
- class vidyut.prakriya.Sanadi
A pratyaya that creates a new dhatu.
- Ric = Sanadi.Ric
- anubandhas()
- static choices()
Return all possible values for this enum.
- drshya()
- static from_string(val)
DEPRECATED – prefer __new__ instead.
Create an enum value from the given string.
This is the inverse of __str__. Performance is currently linear in the number of enum options.
- kAmyac = Sanadi.kAmyac
- kyaN = Sanadi.kyaN
- kyac = Sanadi.kyac
- name
The name used to define the Enum member.
- san = Sanadi.san
- value
The name used to define the Enum member.
The returned value is guaranteed to be identical to the output of __str__.
- yaN = Sanadi.yaN
- yaNluk = Sanadi.yaNluk
- class vidyut.prakriya.Taddhita
The complete list of taddhita pratyayas.
Each pratyaya name is written in the SLP1 encoding scheme.
- Akinic = Taddhita.Akinic
- Arak = Taddhita.Arak
- Baktal = Taddhita.Baktal
- Brawac = Taddhita.Brawac
- Ca = Taddhita.Ca
- CaR = Taddhita.CaR
- Cas = Taddhita.Cas
- DA = Taddhita.DA
- Erak = Taddhita.Erak
- Ga = Taddhita.Ga
- Gac = Taddhita.Gac
- Gan = Taddhita.Gan
- Gas = Taddhita.Gas
- Ikak = Taddhita.Ikak
- Ikan = Taddhita.Ikan
- Iyasun = Taddhita.Iyasun
- Ka = Taddhita.Ka
- KaY = Taddhita.KaY
- PaY = Taddhita.PaY
- Pak = Taddhita.Pak
- PiY = Taddhita.PiY
- Qa = Taddhita.Qa
- QaY = Taddhita.QaY
- Qak = Taddhita.Qak
- QakaY = Taddhita.QakaY
- Qinuk = Taddhita.Qinuk
- Qrak = Taddhita.Qrak
- Ra = Taddhita.Ra
- Rini = Taddhita.Rini
- Rya = Taddhita.Rya
- SAlac = Taddhita.SAlac
- Sa = Taddhita.Sa
- SaNkawac = Taddhita.SaNkawac
- Sas = Taddhita.Sas
- TAl = Taddhita.TAl
- Tamu = Taddhita.Tamu
- Tyan = Taddhita.Tyan
- WaY = Taddhita.WaY
- Wac = Taddhita.Wac
- Wak = Taddhita.Wak
- Wan = Taddhita.Wan
- Wap = Taddhita.Wap
- Ya = Taddhita.Ya
- YiWa = Taddhita.YiWa
- Yya = Taddhita.Yya
- YyaN = Taddhita.YyaN
- Yyaw = Taddhita.Yyaw
- a = Taddhita.a
- aR = Taddhita.aR
- aWac = Taddhita.aWac
- aY = Taddhita.aY
- ac = Taddhita.ac
- akac = Taddhita.akac
- anic = Taddhita.anic
- anubandhas()
- ap = Taddhita.ap
- asic = Taddhita.asic
- astAti = Taddhita.astAti
- at = Taddhita.at
- atasuc = Taddhita.atasuc
- bahuc = Taddhita.bahuc
- biqac = Taddhita.biqac
- birIsac = Taddhita.birIsac
- cPaY = Taddhita.cPaY
- caRap = Taddhita.caRap
- caraw = Taddhita.caraw
- static choices()
Return all possible values for this enum.
- cuYcup = Taddhita.cuYcup
- cvi = Taddhita.cvi
- dA = Taddhita.dA
- dAnIm = Taddhita.dAnIm
- daGnac = Taddhita.daGnac
- deSIyar = Taddhita.deSIyar
- deSya = Taddhita.deSya
- drshya()
- dvayasac = Taddhita.dvayasac
- eRya = Taddhita.eRya
- static from_string(val)
DEPRECATED – prefer __new__ instead.
Create an enum value from the given string.
This is the inverse of __str__. Performance is currently linear in the number of enum options.
- ha = Taddhita.ha
- iY = Taddhita.iY
- ila = Taddhita.ila
- ilac = Taddhita.ilac
- imanic = Taddhita.imanic
- inac = Taddhita.inac
- ini = Taddhita.ini
- itac = Taddhita.itac
- izWan = Taddhita.izWan
- jAhac = Taddhita.jAhac
- jAtIyar = Taddhita.jAtIyar
- ka = Taddhita.ka
- kak = Taddhita.kak
- kalpap = Taddhita.kalpap
- kan = Taddhita.kan
- kap = Taddhita.kap
- kawac = Taddhita.kawac
- kftvasuc = Taddhita.kftvasuc
- kuRap = Taddhita.kuRap
- kuwArac = Taddhita.kuwArac
- lac = Taddhita.lac
- mAtrac = Taddhita.mAtrac
- ma = Taddhita.ma
- map = Taddhita.map
- matup = Taddhita.matup
- mayaw = Taddhita.mayaw
- nAwac = Taddhita.nAwac
- na = Taddhita.na
- naY = Taddhita.naY
- name
The name used to define the Enum member.
- pASap = Taddhita.pASap
- piwac = Taddhita.piwac
- qatamac = Taddhita.qatamac
- qatarac = Taddhita.qatarac
- qati = Taddhita.qati
- qaw = Taddhita.qaw
- qmatup = Taddhita.qmatup
- qupac = Taddhita.qupac
- qvalac = Taddhita.qvalac
- qvun = Taddhita.qvun
- qyaR = Taddhita.qyaR
- rUpap = Taddhita.rUpap
- rUpya = Taddhita.rUpya
- ra = Taddhita.ra
- rhil = Taddhita.rhil
- sAti = Taddhita.sAti
- sa = Taddhita.sa
- sna = Taddhita.sna
- snaY = Taddhita.snaY
- suc = Taddhita.suc
- tIya = Taddhita.tIya
- tal = Taddhita.tal
- tamap = Taddhita.tamap
- tarap = Taddhita.tarap
- tasi = Taddhita.tasi
- tasil = Taddhita.tasil
- tayap = Taddhita.tayap
- ti = Taddhita.ti
- tikan = Taddhita.tikan
- trA = Taddhita.trA
- tral = Taddhita.tral
- tva = Taddhita.tva
- tyak = Taddhita.tyak
- tyakan = Taddhita.tyakan
- tyap = Taddhita.tyap
- tyu = Taddhita.tyu
- tyul = Taddhita.tyul
- valac = Taddhita.valac
- value
The name used to define the Enum member.
The returned value is guaranteed to be identical to the output of __str__.
- vati = Taddhita.vati
- vatup = Taddhita.vatup
- vaya = Taddhita.vaya
- viDal = Taddhita.viDal
- vini = Taddhita.vini
- vuY = Taddhita.vuY
- vuk = Taddhita.vuk
- vun = Taddhita.vun
- vyan = Taddhita.vyan
- vyat = Taddhita.vyat
- wIwac = Taddhita.wIwac
- wac = Taddhita.wac
- waq = Taddhita.waq
- weRyaR = Taddhita.weRyaR
- wiWan = Taddhita.wiWan
- wlaY = Taddhita.wlaY
- wyaR = Taddhita.wyaR
- wyu = Taddhita.wyu
- wyul = Taddhita.wyul
- ya = Taddhita.ya
- yaY = Taddhita.yaY
- yak = Taddhita.yak
- yan = Taddhita.yan
- yat = Taddhita.yat
- yus = Taddhita.yus
- zPak = Taddhita.zPak
- zWac = Taddhita.zWac
- zWal = Taddhita.zWal
- zWan = Taddhita.zWan
- za = Taddhita.za
- zkan = Taddhita.zkan
- zwarac = Taddhita.zwarac
- zyaN = Taddhita.zyaN
- zyaY = Taddhita.zyaY
- class vidyut.prakriya.Vacana
The number of some tinanta or subanta.
- Bahu = Vacana.Bahu
- Dvi = Vacana.Dvi
- Eka = Vacana.Eka
- static choices()
Return all possible values for this enum.
- static from_string(val)
DEPRECATED – prefer __new__ instead.
Create an enum value from the given string.
This is the inverse of __str__. Performance is currently linear in the number of enum options.
- name
The name used to define the Enum member.
- value
The name used to define the Enum member.
The returned value is guaranteed to be identical to the output of __str__.
- class vidyut.prakriya.Vibhakti
The case ending of some subanta.
- Caturthi = Vibhakti.Caturthi
- Dvitiya = Vibhakti.Dvitiya
- Panchami = Vibhakti.Panchami
- Prathama = Vibhakti.Prathama
- Sambodhana = Vibhakti.Sambodhana
- Saptami = Vibhakti.Saptami
- Sasthi = Vibhakti.Sasthi
- Trtiya = Vibhakti.Trtiya
- static choices()
Return all possible values for this enum.
- static from_string(val)
DEPRECATED – prefer __new__ instead.
Create an enum value from the given string.
This is the inverse of __str__. Performance is currently linear in the number of enum options.
- name
The name used to define the Enum member.
- value
The name used to define the Enum member.
The returned value is guaranteed to be identical to the output of __str__.
Output types
- class vidyut.prakriya.Prakriya
A derivation.
- history
All of the steps that were applied during the derivation.
- text
The final output of the derivation.
text is an SLP1 string.
- class vidyut.prakriya.Step
A step in the derivation.
- code
The ID of the rule that was applied, e.g. “3.1.68”. Most rules are from the Ashtadhyayi, but a small number of rules are from other sources. See the source attribute to learn where a rule has come from.
- result
The terms produced by this result.
- source
The source of the rule that was applied. This is almost always Source.Ashtadhyayi, but some derivations may use rules from other sources (e.g. the Dhatupatha).
- class vidyut.prakriya.Term
- text
The text of this term in SLP1 transliteration.
- was_changed
Whether or not this term was changed.
- class vidyut.prakriya.Source
Defines the source of some rule.
- Ashtadhyayi = Source.Ashtadhyayi
- Dhatupatha = Source.Dhatupatha
- Kashika = Source.Kashika
- Kaumudi = Source.Kaumudi
- Linganushasana = Source.Linganushasana
- Phit = Source.Phit
- Unadipatha = Source.Unadipatha
- Varttika = Source.Varttika
- static choices()
Return all possible values for this enum.
- static from_string(val)
DEPRECATED – prefer __new__ instead.
Create an enum value from the given string.
This is the inverse of __str__.
- name
The name used to define the Enum member.
(Defined for compatibility with Python enums.)
- value
The value used to define the Enum member.
(Defined for compatibility with Python enums.)
vidyut.sandhi
vidyut.sandhi handles sandhi changes between words.
- class vidyut.sandhi.Split
Models a sandhi split.
- first
The first part of the split.
- is_valid
Whether the split is phonetically valid according to some basic heuristics.
- second
The second part of the split.
- class vidyut.sandhi.Splitter
A sandhi splitter.
- static from_csv(path)
Create a sandhi splitter from the given path.
path should be a CSV with columns first, second, and result.
- split_at(text, index)
Return all possible ways to split text at the given index.
The first field in the split is guaranteed to be non-empty.