सारे जहाँ से अच्छा है
सबसे प्यारा देश है
क़ुर्बान-ए-जहाँ है
अमन-ए-बहारा है
हरियाली का चादर है
हिदायत की नूर है
यह है इंडिया यह है इंडिया हे हे
यह है इंडिया यह है इंडिया हे हे
रोज़ सुनते हैं दास्तान सरफरोशी का
पर चाहते हैं बरकत का नगमा
रोज़ पीते हैं पीते हैं ज़हर ग़म का
पर चाहते हैं खुशी का प्याला
बन्दूक बम्ब से न डरना सीना तानके आगे बढ़ना
दक्का खाके गिरना उठना दरियाओं को पार करना
यह है इंडिया यह है इंडिया हे हे
यह है इंडिया यह है इंडिया हे हे
गाते रहेंगे एकता का नारा
साथ मिलके गाएंगे सारी जनता
शुक्र करते है अपने जवानों का
और शहीदों को हमारा सलाम
बन्दूक बम्ब से न डरना सीना तानके आगे बढ़ना
दक्का खाके गिरना उठना दरियाओं को पार करना
यह है इंडिया यह है इंडिया हे हे
यह है इंडिया यह है इंडिया हे हे
सारे जहाँ से अच्छा है
सबसे प्यारा देश है
यह है इंडिया यह है इंडिया हे हे
यह है इंडिया यह है इंडिया हे हे
Wednesday, December 31, 2008
Monday, December 15, 2008
Parsing and Karma
NOTE: Some parts of the text from this blog is copied from Wikipedia as a source of information.
Hypothesis: Every sentence that has to be parsed is analogous to every life that has to be lived.
Variables: Karma as in Action, input string as life, grammar as laws of nature and the Parsing algorithm as in Samsara (the cycle).
Karma:
Samsara Algorithm:-
While (A Jiva cannot attain moksha until the accumulated sanchita karmas are completely exhausted)
{
From this stock of sanchita karma, a handful is taken out to serve one lifetime and this handful of actions.
prarabdha karmas begun to bear fruit and which will be exhausted only on their fruit being enjoyed and not otherwise.
as prarabdha karma for being enjoyed in one lifetime, leading to the cycle of birth and death.
All kriyamana karmas become sanchita karma upon completion.
}
As an example of a Parsing Algorithm, I found Earley Parsing Algorithm as the closest analogy to the Samsara algorithm. I could only find this algorithm given the limitations of my perspective and intellect. One may find a better analogy on any given day.
Earley Parsing Algorithm:-
Earley's algorithm is a top-down dynamic programming algorithm. In the following, we use Earley's dot notation: given a production X → αβ, the notation X → α • β represents a condition in which α has already been parsed and β is expected.
For every input position (which represents a position between tokens), the parser generates an ordered state set. Each state is a tuple (X → α • β, i), consisting of
The state set at input position k is called S(k). The parser is seeded with S(0) consisting of only the top-level rule. The parser then iteratively operates in three stages: prediction, scanning, and completion.
Prediction: For every state in S(k) of the form (X → α • Y β, j) (where j is the origin position as above), add (Y → • γ, k) to S(k) for every production with Y on the left-hand side. Kriyamana Karma (current action)
Scanning: If a is the next symbol in the input stream, for every state in S(k) of the form (X → α • a β, j), add (X → α a • β, j) to S(k+1). Prarabdha Karma (fruitful action)
Completion: For every state in S(k) of the form (X → γ •, j), find states in S(j) of the form (Y → α • X β, i) and add (Y → α X • β, i) to S(k). Sanchitha Karma (accumulated actions)
Hypothesis: Every sentence that has to be parsed is analogous to every life that has to be lived.
Variables: Karma as in Action, input string as life, grammar as laws of nature and the Parsing algorithm as in Samsara (the cycle).
Karma:
- Kriyamana Karma(current action) is the karma that human beings are creating in the present, the fruits of which will be experienced in the future.
- Sanchitha Karma(accumulated actions) is the sum of one's past karmas – all actions (good and bad) from one's past life follow through to the next life.
- Prarabdha Karma(fruitful actions) is that portion of the sanchita karma which influences human life in the present incarnation is called prarabdha.
Samsara Algorithm:-
While (A Jiva cannot attain moksha until the accumulated sanchita karmas are completely exhausted)
{
From this stock of sanchita karma, a handful is taken out to serve one lifetime and this handful of actions.
prarabdha karmas begun to bear fruit and which will be exhausted only on their fruit being enjoyed and not otherwise.
as prarabdha karma for being enjoyed in one lifetime, leading to the cycle of birth and death.
All kriyamana karmas become sanchita karma upon completion.
}
As an example of a Parsing Algorithm, I found Earley Parsing Algorithm as the closest analogy to the Samsara algorithm. I could only find this algorithm given the limitations of my perspective and intellect. One may find a better analogy on any given day.
Earley Parsing Algorithm:-
Earley's algorithm is a top-down dynamic programming algorithm. In the following, we use Earley's dot notation: given a production X → αβ, the notation X → α • β represents a condition in which α has already been parsed and β is expected.
For every input position (which represents a position between tokens), the parser generates an ordered state set. Each state is a tuple (X → α • β, i), consisting of
- the production currently being matched (X → α β)
- our current position in that production (represented by the dot)
- the position i in the input at which the matching of this production began: the origin position
The state set at input position k is called S(k). The parser is seeded with S(0) consisting of only the top-level rule. The parser then iteratively operates in three stages: prediction, scanning, and completion.
Prediction: For every state in S(k) of the form (X → α • Y β, j) (where j is the origin position as above), add (Y → • γ, k) to S(k) for every production with Y on the left-hand side. Kriyamana Karma (current action)
Scanning: If a is the next symbol in the input stream, for every state in S(k) of the form (X → α • a β, j), add (X → α a • β, j) to S(k+1). Prarabdha Karma (fruitful action)
Completion: For every state in S(k) of the form (X → γ •, j), find states in S(j) of the form (Y → α • X β, i) and add (Y → α X • β, i) to S(k). Sanchitha Karma (accumulated actions)
Subscribe to:
Posts (Atom)