bindu 1.8.1 → 1.10.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 +11 -0
- package/README.md +18 -7
- package/lib/bindu.js +4 -2
- package/lib/pratyahara.js +26 -0
- package/lib/sandhi/{apply-ayadaya → ac/apply-ayadaya}/index.js +1 -1
- package/lib/sandhi/{apply-padantad → ac/apply-padantad}/index.js +1 -1
- package/lib/sandhi/visarga/apply-bhobhago/index.js +47 -0
- package/lib/sandhi/visarga/apply-kharovasana/index.js +35 -0
- package/lib/sandhi/visarga/apply-rori/index.js +39 -0
- package/lib/sandhi/visarga/index.js +9 -0
- package/package.json +1 -1
- /package/lib/sandhi/{apply-dirgha → ac/apply-dirgha}/index.js +0 -0
- /package/lib/sandhi/{apply-guna → ac/apply-guna}/index.js +0 -0
- /package/lib/sandhi/{apply-purvarupa → ac/apply-purvarupa}/index.js +0 -0
- /package/lib/sandhi/{apply-vriddhi → ac/apply-vriddhi}/index.js +0 -0
- /package/lib/sandhi/{apply-yan → ac/apply-yan}/index.js +0 -0
- /package/lib/sandhi/{index.js → ac/index.js} +0 -0
package/ChangeLog
CHANGED
package/README.md
CHANGED
|
@@ -45,13 +45,21 @@ places[0].message;
|
|
|
45
45
|
|
|
46
46
|
### Sandhi
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- ✅[`
|
|
51
|
-
- ✅[`
|
|
52
|
-
- ✅[`
|
|
53
|
-
- ✅[`
|
|
54
|
-
- ✅[`
|
|
48
|
+
#### ac
|
|
49
|
+
|
|
50
|
+
- ✅[`ac/apply-dirgha`](https://putout.cloudcmd.io/#/gist/0ad8154614be489ae50931109618100a/5ce86f7344b37fd40afeb229e6cb1f668d4f92fd): [अकः सवर्णे दीर्घः](https://www.learnsanskrit.org/vyakarana/sounds/ac-sandhi/#:~: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);
|
|
51
|
+
- ✅[`ac/apply-yan`](https://putout.cloudcmd.io/#/gist/3091528d3d3eb095032fbec200599df0/c4dcefa2d29fd85f9d3d768b6eaf6934fd5a3fbb): [इको यणचि](https://www.learnsanskrit.org/vyakarana/sounds/vidhi-rules);
|
|
52
|
+
- ✅[`ac/apply-guna`](https://putout.cloudcmd.io/#/gist/c057229cbbedf356c1d317022141f8ca/dea60bda78c84f12aef77a9e08bc17274d66c65e): [आद्गुणः](https://www.learnsanskrit.org/panini/vowel/#:~: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);
|
|
53
|
+
- ✅[`ac/apply-vriddhi`](https://putout.cloudcmd.io/#/gist/7cdc2383c74d7afeb8cfd93df7b5f868/79b1c979be725fc082cf81991b16fac527cfcd7b): [वृद्धिरेचि](https://www.learnsanskrit.org/panini/vowel/#:~: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);
|
|
54
|
+
- ✅[`ac/apply-purvarupa`](https://putout.cloudcmd.io/#/gist/23e2b612a185529ea6823e5f81d35b7d/2ace30ac469be03af1c41911b78d85e85b9a1120): [एकः पूर्वपरयोः](https://www.learnsanskrit.org/panini/vowel/#:~: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)
|
|
55
|
+
- ✅[`ac/apply-ayadaya`](https://putout.cloudcmd.io/#/gist/39db56c40174f61caed795c2a2dc89a7/dc956c6b0834167d9814ba70036674f4a10f56f9): [आयादयः](https://www.learnsanskrit.org/references/sandhi/vowel/#:~:text=madhu%20iva%20%E2%86%92%20madhviva-,Now,-%2C%20some%20examples%20for)
|
|
56
|
+
- ✅[`ac/apply-padantad`](https://putout.cloudcmd.io/#/gist/f73f49bf102a6f2ab34a100ee29f81cc/6b1c3f1595841a08a035437924165e4b8d27896d): [एङः पदान्तादति](https://www.gingersunrise.com/i/133147357/एङ-पदनतदत);
|
|
57
|
+
|
|
58
|
+
#### visarga
|
|
59
|
+
|
|
60
|
+
- ✅[`visarga/apply-rori`](https://putout.cloudcmd.io/#/gist/839c4d49726a2f869dc2854a110001d9/f443ecb1522b2b0f8d18a86eaaf8bdfe9325eaf6): [रो रि।](https://www.learnsanskrit.org/vyakarana/sounds/hal-sandhi/#:~:text=rule%208.3.15%20below%3A-,%E0%A4%B0%E0%A5%8B%20%E0%A4%B0%E0%A4%BF%E0%A5%A4%20%E0%A5%AE.%E0%A5%A9.%E0%A5%A7%E0%A5%AA,-ro%20ri%20);
|
|
61
|
+
- ✅[`visarga/apply-bhobhago`](https://putout.cloudcmd.io/#/gist/839c4d49726a2f869dc2854a110001d9/f443ecb1522b2b0f8d18a86eaaf8bdfe9325eaf6): [भोभगोअघोअपूर्वस्य योऽशि](https://ashtadhyayi.com/sutraani/8/3/17);
|
|
62
|
+
- ✅[`visarga/apply-kharovasana`](https://putout.cloudcmd.io/#/gist/425cfcba3ba6dd2bb4a6692fc6fb6959/bc3fb244c2bbe03597e3ae2ab85473ae46a5f22b):[खरवसानयोर्विसर्जनीयः](https://ashtadhyayi.com/sutraani/8/3/15);
|
|
55
63
|
|
|
56
64
|
#### apply-padantad
|
|
57
65
|
|
|
@@ -79,6 +87,7 @@ bhoati → bhavati
|
|
|
79
87
|
#### apply-ayadaya
|
|
80
88
|
|
|
81
89
|
##### ए
|
|
90
|
+
|
|
82
91
|
```
|
|
83
92
|
ए + अ → अय
|
|
84
93
|
e + a → aya
|
|
@@ -97,6 +106,7 @@ e + o → eyo
|
|
|
97
106
|
```
|
|
98
107
|
|
|
99
108
|
##### ओ
|
|
109
|
+
|
|
100
110
|
```
|
|
101
111
|
ओ + अ → अव
|
|
102
112
|
o + a → av
|
|
@@ -119,6 +129,7 @@ ai + i → āyi
|
|
|
119
129
|
```
|
|
120
130
|
|
|
121
131
|
##### औ
|
|
132
|
+
|
|
122
133
|
```
|
|
123
134
|
औ + अ → आव
|
|
124
135
|
au + a → āvā
|
package/lib/bindu.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import putout from 'putout';
|
|
2
2
|
import Sanscript from '@indic-transliteration/sanscript';
|
|
3
|
-
import * as
|
|
3
|
+
import * as acSandhi from './sandhi/ac/index.js';
|
|
4
|
+
import * as visargaSandhi from './sandhi/visarga/index.js';
|
|
4
5
|
import {postProcess, preProcess} from './process.js';
|
|
5
6
|
|
|
6
7
|
export const toSLP1 = (a) => Sanscript.t(a, 'devanagari', 'slp1');
|
|
@@ -14,7 +15,8 @@ export const bindu = (text, overrides = {}) => {
|
|
|
14
15
|
const {code, places} = putout(source, {
|
|
15
16
|
fix,
|
|
16
17
|
plugins: [
|
|
17
|
-
['sandhi',
|
|
18
|
+
['sandhi/ac', acSandhi],
|
|
19
|
+
['sandhi/visarga', visargaSandhi],
|
|
18
20
|
],
|
|
19
21
|
});
|
|
20
22
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const ac = [
|
|
2
|
+
'a',
|
|
3
|
+
'i',
|
|
4
|
+
'u',
|
|
5
|
+
'f',
|
|
6
|
+
'x',
|
|
7
|
+
'e',
|
|
8
|
+
'o',
|
|
9
|
+
'ai',
|
|
10
|
+
'au',
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
const khar = [
|
|
14
|
+
'k',
|
|
15
|
+
'c',
|
|
16
|
+
'w',
|
|
17
|
+
't',
|
|
18
|
+
'p',
|
|
19
|
+
'z',
|
|
20
|
+
's',
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const createAsti = (a) => (b) => a.includes(b.toLowerCase());
|
|
24
|
+
|
|
25
|
+
export const astiAc = createAsti(ac);
|
|
26
|
+
export const astiKhar = createAsti(khar);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {operator} from 'putout';
|
|
2
|
+
import {astiAc} from '../../../pratyahara.js';
|
|
3
|
+
|
|
4
|
+
const {remove} = operator;
|
|
5
|
+
const purvasya = [
|
|
6
|
+
'bhoH',
|
|
7
|
+
'bhagoH',
|
|
8
|
+
'aghoH',
|
|
9
|
+
'namaH',
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
export const report = () => `bhobhago’gho’pūrvasya yo’śi`;
|
|
13
|
+
|
|
14
|
+
export const fix = ({path, next, name, nextName}) => {
|
|
15
|
+
path.node.name = `${name.slice(0, -2)}o'${nextName}`;
|
|
16
|
+
remove(next);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const traverse = ({push}) => ({
|
|
20
|
+
Identifier(path) {
|
|
21
|
+
const next = path.getNextSibling();
|
|
22
|
+
|
|
23
|
+
if (!next.node)
|
|
24
|
+
return;
|
|
25
|
+
|
|
26
|
+
const {name} = path.node;
|
|
27
|
+
|
|
28
|
+
if (!purvasya.includes(name))
|
|
29
|
+
return;
|
|
30
|
+
|
|
31
|
+
const nextName = next.node.name;
|
|
32
|
+
|
|
33
|
+
const first = nextName
|
|
34
|
+
.at(0)
|
|
35
|
+
.toLowerCase();
|
|
36
|
+
|
|
37
|
+
if (!astiAc(first))
|
|
38
|
+
return;
|
|
39
|
+
|
|
40
|
+
push({
|
|
41
|
+
path,
|
|
42
|
+
next,
|
|
43
|
+
name,
|
|
44
|
+
nextName,
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {astiKhar} from '../../../pratyahara.js';
|
|
2
|
+
|
|
3
|
+
export const report = () => `kharavasānayor visarjanīyaḥ`;
|
|
4
|
+
|
|
5
|
+
export const fix = ({path, name}) => {
|
|
6
|
+
path.node.name = `${name.slice(0, -1)}H`;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const traverse = ({push}) => ({
|
|
10
|
+
Identifier(path) {
|
|
11
|
+
const next = path.getNextSibling();
|
|
12
|
+
|
|
13
|
+
if (!next.node)
|
|
14
|
+
return;
|
|
15
|
+
|
|
16
|
+
const {name} = path.node;
|
|
17
|
+
|
|
18
|
+
const nextName = next.node.name;
|
|
19
|
+
const first = nextName.at(0);
|
|
20
|
+
const last = name.at(-1);
|
|
21
|
+
|
|
22
|
+
if (!/[sr]/.test(last))
|
|
23
|
+
return;
|
|
24
|
+
|
|
25
|
+
if (!astiKhar(first))
|
|
26
|
+
return;
|
|
27
|
+
|
|
28
|
+
push({
|
|
29
|
+
path,
|
|
30
|
+
next,
|
|
31
|
+
name,
|
|
32
|
+
nextName,
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {operator} from 'putout';
|
|
2
|
+
import {astiAc} from '../../../pratyahara.js';
|
|
3
|
+
|
|
4
|
+
const {remove} = operator;
|
|
5
|
+
|
|
6
|
+
export const report = () => `ro ri`;
|
|
7
|
+
|
|
8
|
+
export const fix = ({path, next, name, nextName}) => {
|
|
9
|
+
path.node.name = `${name.slice(0, -1)}r${nextName}`;
|
|
10
|
+
remove(next);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const traverse = ({push}) => ({
|
|
14
|
+
Identifier(path) {
|
|
15
|
+
const next = path.getNextSibling();
|
|
16
|
+
|
|
17
|
+
if (!next.node)
|
|
18
|
+
return;
|
|
19
|
+
|
|
20
|
+
const {name} = path.node;
|
|
21
|
+
const nextName = next.node.name;
|
|
22
|
+
|
|
23
|
+
const first = nextName
|
|
24
|
+
.at(0)
|
|
25
|
+
.toLowerCase();
|
|
26
|
+
|
|
27
|
+
const last = name.at(-1);
|
|
28
|
+
|
|
29
|
+
if (last !== 'H' || !astiAc(first))
|
|
30
|
+
return;
|
|
31
|
+
|
|
32
|
+
push({
|
|
33
|
+
path,
|
|
34
|
+
next,
|
|
35
|
+
name,
|
|
36
|
+
nextName,
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as applyKharovasana from './apply-kharovasana/index.js';
|
|
2
|
+
import * as applyBhobhago from './apply-bhobhago/index.js';
|
|
3
|
+
import * as applyRori from './apply-rori/index.js';
|
|
4
|
+
|
|
5
|
+
export const rules = {
|
|
6
|
+
'apply-bhobhago': applyBhobhago,
|
|
7
|
+
'apply-rori': applyRori,
|
|
8
|
+
'apply-kharovasana': applyKharovasana,
|
|
9
|
+
};
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|