bindu 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ 2025.12.10, v1.4.0
2
+
3
+ feature:
4
+ - 788d5ad bindu: sandhi: apply-purvarupa: add
5
+
6
+ 2025.12.08, v1.3.0
7
+
8
+ feature:
9
+ - e8cfd00 bindu: sindhi: apply-vriddhi: add
10
+
1
11
  2025.12.08, v1.2.0
2
12
 
3
13
  fix:
package/README.md CHANGED
@@ -39,9 +39,29 @@ places[0].message;
39
39
 
40
40
  ## Rules
41
41
 
42
+ ### Sandhi
43
+
42
44
  - ✅[`sandhi/apply-dirgha`](https://putout.cloudcmd.io/#/gist/0ad8154614be489ae50931109618100a/5ce86f7344b37fd40afeb229e6cb1f668d4f92fd): [अकः सवर्णे दीर्घः](https://www.learnsanskrit.org/vyakarana/sounds/ac-sandhi/?utm_source=chatgpt.com#:~:text=a%20new%20rule%3A-,%E0%A4%85%E0%A4%95%E0%A4%83%20%E0%A4%B8%E0%A4%B5%E0%A4%B0%E0%A5%8D%E0%A4%A3%E0%A5%87%20%E0%A4%A6%E0%A5%80%E0%A4%B0%E0%A5%8D%E0%A4%98%E0%A4%83%E0%A5%A4%20%E0%A5%AC.%E0%A5%A7.%E0%A5%A7%E0%A5%A6%E0%A5%A7,-aka%E1%B8%A5%20savar%E1%B9%87e%20d%C4%ABrgha%E1%B8%A5);
43
45
  - ✅[`sandhi/apply-yan`](https://putout.cloudcmd.io/#/gist/3091528d3d3eb095032fbec200599df0/c4dcefa2d29fd85f9d3d768b6eaf6934fd5a3fbb): [इको यणचि](https://www.learnsanskrit.org/vyakarana/sounds/vidhi-rules);
44
46
  - ✅[`sandhi/apply-guna`](https://putout.cloudcmd.io/#/gist/c057229cbbedf356c1d317022141f8ca/dea60bda78c84f12aef77a9e08bc17274d66c65e): [आद्गुणः](https://www.learnsanskrit.org/panini/vowel/?utm_source=chatgpt.com#:~:text=in%20ayav%C4%81y%C4%81v.-,6.1.87,-%E0%A4%86%E0%A4%A6%E0%A5%8D%E0%A4%97%E0%A5%81%E0%A4%A3%E0%A4%83);
47
+ - ✅[`sandhi/apply-vriddhi`](https://putout.cloudcmd.io/#/gist/7cdc2383c74d7afeb8cfd93df7b5f868/79b1c979be725fc082cf81991b16fac527cfcd7b): [वृद्धिरेचि](https://www.learnsanskrit.org/panini/vowel/?utm_source=chatgpt.com#:~:text=and%20%C4%81.-,6.1.88,-%E0%A4%B5%E0%A5%83%E0%A4%A6%E0%A5%8D%E0%A4%A7%E0%A4%BF%E0%A4%B0%E0%A5%87%E0%A4%9A%E0%A4%BF);
48
+ - ✅[`sandhi/apply-purvarupa`](https://putout.cloudcmd.io/#/gist/23e2b612a185529ea6823e5f81d35b7d/2ace30ac469be03af1c41911b78d85e85b9a1120): [एकः पूर्वपरयोः](https://www.learnsanskrit.org/panini/vowel/?utm_source=chatgpt.com#:~:text=this%20rule%20mean%3F-,%E0%A4%8F%E0%A4%95%E0%A4%83%20%E0%A4%AA%E0%A5%82%E0%A4%B0%E0%A5%8D%E0%A4%B5%E0%A4%AA%E0%A4%B0%E0%A4%AF%E0%A5%8B%E0%A4%83,-eka%E1%B8%A5%20p%C5%ABrvaparayo%E1%B8%A5)
49
+
50
+ #### apply-dirgha
51
+
52
+ ```
53
+ अ + अ → आ
54
+ a + a → ā
55
+
56
+ इ + इ → ई
57
+ i + i → ī
58
+
59
+ उ + उ → ऊ
60
+ u + u → ū
61
+
62
+ ऋ + ऋ → ॠ
63
+ ṛ + ṛ → ṝ
64
+ ```
45
65
 
46
66
  ## License
47
67
 
@@ -0,0 +1,40 @@
1
+ import {operator} from 'putout';
2
+
3
+ const {remove} = operator;
4
+
5
+ export const report = () => `ekaḥ pūrvaparayoḥ`;
6
+
7
+ export const fix = ({path, next, name, nextName}) => {
8
+ path.node.name = `${name}'${nextName.slice(1)}`;
9
+ remove(next);
10
+ };
11
+
12
+ export const traverse = ({push}) => ({
13
+ Identifier(path) {
14
+ const next = path.getNextSibling();
15
+
16
+ if (!next.node)
17
+ return;
18
+
19
+ const {name} = path.node;
20
+ const nextName = next.node.name;
21
+
22
+ const last = name
23
+ .at(-1)
24
+ .toLowerCase();
25
+
26
+ const first = nextName
27
+ .at(0)
28
+ .toLowerCase();
29
+
30
+ if (first !== 'a' || !/[eo]/.test(last))
31
+ return;
32
+
33
+ push({
34
+ path,
35
+ next,
36
+ name,
37
+ nextName,
38
+ });
39
+ },
40
+ });
@@ -0,0 +1,47 @@
1
+ import {operator} from 'putout';
2
+
3
+ const {remove} = operator;
4
+ const SANDHI = {
5
+ e: 'ai',
6
+ o: 'au',
7
+ };
8
+
9
+ export const report = () => `vṛddhireci`;
10
+
11
+ export const fix = ({path, next, name, nextName, vriddhi}) => {
12
+ path.node.name = `${name.slice(0, -1)}${vriddhi}${nextName.slice(1)}`;
13
+ remove(next);
14
+ };
15
+
16
+ export const traverse = ({push}) => ({
17
+ Identifier(path) {
18
+ const next = path.getNextSibling();
19
+
20
+ if (!next.node)
21
+ return;
22
+
23
+ const {name} = path.node;
24
+ const nextName = next.node.name;
25
+
26
+ const last = name
27
+ .at(-1)
28
+ .toLowerCase();
29
+
30
+ const first = nextName
31
+ .at(0)
32
+ .toLowerCase();
33
+
34
+ if (last !== 'a' || !/[eo]/.test(first))
35
+ return;
36
+
37
+ const vriddhi = SANDHI[first];
38
+
39
+ push({
40
+ path,
41
+ next,
42
+ vriddhi,
43
+ name,
44
+ nextName,
45
+ });
46
+ },
47
+ });
@@ -1,3 +1,5 @@
1
+ import * as applyPurvarupa from './apply-purvarupa/index.js';
2
+ import * as applyVriddhi from './apply-vriddhi/index.js';
1
3
  import * as applyGuna from './apply-guna/index.js';
2
4
  import * as applyYan from './apply-yan/index.js';
3
5
  import * as applyDirgha from './apply-dirgha/index.js';
@@ -6,4 +8,6 @@ export const rules = {
6
8
  'apply-dirgha': applyDirgha,
7
9
  'apply-yan': applyYan,
8
10
  'apply-guna': applyGuna,
11
+ 'apply-vriddhi': applyVriddhi,
12
+ 'apply-purvarupa': applyPurvarupa,
9
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bindu",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Pāṇini Aṣṭādhyāyī",
5
5
  "main": "lib/bindu.js",
6
6
  "bin": {