bindu 1.12.0 → 2.0.1
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 +14 -0
- package/README.md +13 -0
- package/lib/avyaya/particles.js +1 -0
- package/lib/sandhi/ac/apply-guna/index.js +4 -1
- package/lib/sandhi/ac/apply-purvarupa/index.js +70 -17
- package/lib/sandhi/ac/apply-vriddhi/index.js +3 -0
- package/lib/sandhi/ac/apply-yan/index.js +1 -0
- package/package.json +5 -5
package/ChangeLog
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
2026.10.15, v2.0.1
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 4b1210f sandhi: ac: apply-purvarupa
|
|
5
|
+
|
|
6
|
+
2026.10.15, v2.0.0
|
|
7
|
+
|
|
8
|
+
feature:
|
|
9
|
+
- 07413ca bindu: drop support of node < 22
|
|
10
|
+
- a6c4ab2 apply-guna: ri
|
|
11
|
+
- ef0e84a bindu: supertape v13.2.0
|
|
12
|
+
- ddcf818 bindu: montag v2.0.1
|
|
13
|
+
- 9fa29c3 bindu: superc8 v12.7.0
|
|
14
|
+
|
|
1
15
|
2026.02.18, v1.12.0
|
|
2
16
|
|
|
3
17
|
feature:
|
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ npm i bindu -g
|
|
|
27
27
|
import {bindu} from 'bindu';
|
|
28
28
|
|
|
29
29
|
bindu('प्रतिएक');
|
|
30
|
+
|
|
30
31
|
// returns {code: 'प्रत्येक'}
|
|
31
32
|
bindu('द्रौपदी अश्वम्', {
|
|
32
33
|
type: 'iast',
|
|
@@ -85,6 +86,18 @@ au + a → au'
|
|
|
85
86
|
bhoati → bhavati
|
|
86
87
|
```
|
|
87
88
|
|
|
89
|
+
#### apply-guna
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
भूत्वा + इह → भूत्वेह
|
|
93
|
+
bhUtvA + iha → bhUtveha
|
|
94
|
+
bhūtvā + iha → bhūtveha
|
|
95
|
+
|
|
96
|
+
देव + ऋषि → देवर्षि
|
|
97
|
+
deva + fzi → devarzi
|
|
98
|
+
deva + ṛṣi → devarṣi
|
|
99
|
+
```
|
|
100
|
+
|
|
88
101
|
#### apply-ayadaya
|
|
89
102
|
|
|
90
103
|
##### ए
|
package/lib/avyaya/particles.js
CHANGED
|
@@ -4,8 +4,11 @@ const {remove} = operator;
|
|
|
4
4
|
const SANDHI = {
|
|
5
5
|
i: 'e',
|
|
6
6
|
u: 'o',
|
|
7
|
+
f: 'ar',
|
|
7
8
|
};
|
|
8
9
|
|
|
10
|
+
const isSandhiVowel = (c) => Object.hasOwn(SANDHI, c);
|
|
11
|
+
|
|
9
12
|
export const report = () => `ād‑guṇaḥ`;
|
|
10
13
|
|
|
11
14
|
export const fix = ({path, next, name, nextName, guna}) => {
|
|
@@ -31,7 +34,7 @@ export const traverse = ({push}) => ({
|
|
|
31
34
|
.at(0)
|
|
32
35
|
.toLowerCase();
|
|
33
36
|
|
|
34
|
-
if (last !== 'a' ||
|
|
37
|
+
if (last !== 'a' || !isSandhiVowel(first))
|
|
35
38
|
return;
|
|
36
39
|
|
|
37
40
|
const guna = SANDHI[first];
|
|
@@ -1,44 +1,97 @@
|
|
|
1
|
-
import {operator} from 'putout';
|
|
2
1
|
import {avyayamAsti} from '#avyaya';
|
|
3
2
|
|
|
4
|
-
const {remove} = operator;
|
|
5
|
-
|
|
6
3
|
export const report = () => `ekaḥ pūrvaparayoḥ`;
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const DIRGHA = {
|
|
6
|
+
a: 'A',
|
|
7
|
+
A: 'A',
|
|
8
|
+
i: 'I',
|
|
9
|
+
I: 'I',
|
|
10
|
+
u: 'U',
|
|
11
|
+
U: 'U',
|
|
12
|
+
f: 'F',
|
|
13
|
+
x: 'X',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const YAN = {
|
|
17
|
+
i: 'y',
|
|
18
|
+
I: 'y',
|
|
19
|
+
u: 'v',
|
|
20
|
+
U: 'v',
|
|
21
|
+
f: 'r',
|
|
22
|
+
x: 'l',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const fix = ({path, name, nextName, kind, yan, dirgha}) => {
|
|
26
|
+
if (kind === 'dirgha') {
|
|
27
|
+
path.node.name = `${name.slice(0, -1)}${dirgha}${nextName.slice(1)}`;
|
|
28
|
+
path.parentPath.node.expressions.pop();
|
|
29
|
+
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (kind === 'yan') {
|
|
34
|
+
path.node.name = `${name.slice(0, -1)}${yan}${nextName}`;
|
|
35
|
+
path.parentPath.node.expressions.pop();
|
|
36
|
+
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
11
39
|
};
|
|
12
40
|
|
|
13
41
|
export const traverse = ({push}) => ({
|
|
14
42
|
Identifier(path) {
|
|
15
43
|
const next = path.getNextSibling();
|
|
16
44
|
|
|
45
|
+
if (!path.parentPath.isSequenceExpression())
|
|
46
|
+
return;
|
|
47
|
+
|
|
17
48
|
if (!next.node)
|
|
18
49
|
return;
|
|
19
50
|
|
|
20
51
|
const {name} = path.node;
|
|
21
52
|
const nextName = next.node.name;
|
|
22
53
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
54
|
+
if (!avyayamAsti(nextName))
|
|
55
|
+
return;
|
|
56
|
+
|
|
57
|
+
const last = name.at(-1);
|
|
58
|
+
const lastLow = last.toLowerCase();
|
|
26
59
|
|
|
27
60
|
const first = nextName
|
|
28
61
|
.at(0)
|
|
29
62
|
.toLowerCase();
|
|
30
63
|
|
|
31
|
-
if (
|
|
64
|
+
if (!/[aiuefxAIUEOoFX]/.test(last))
|
|
32
65
|
return;
|
|
33
66
|
|
|
34
|
-
if (
|
|
67
|
+
if (first === 'a' && lastLow === 'e')
|
|
35
68
|
return;
|
|
36
69
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
70
|
+
if (first === 'a' && lastLow === 'o')
|
|
71
|
+
return;
|
|
72
|
+
|
|
73
|
+
if (lastLow === first && DIRGHA[last]) {
|
|
74
|
+
push({
|
|
75
|
+
path,
|
|
76
|
+
next,
|
|
77
|
+
name,
|
|
78
|
+
nextName,
|
|
79
|
+
kind: 'dirgha',
|
|
80
|
+
dirgha: DIRGHA[last],
|
|
81
|
+
});
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (YAN[last] && /[aiueoAIUEOfx]/.test(first)) {
|
|
86
|
+
push({
|
|
87
|
+
path,
|
|
88
|
+
next,
|
|
89
|
+
name,
|
|
90
|
+
nextName,
|
|
91
|
+
kind: 'yan',
|
|
92
|
+
yan: YAN[last],
|
|
93
|
+
});
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
43
96
|
},
|
|
44
97
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bindu",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Pāṇini Aṣṭādhyāyī",
|
|
5
5
|
"main": "lib/bindu.js",
|
|
6
6
|
"bin": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"homepage": "https://github.com/putoutjs/bindu",
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"engines": {
|
|
39
|
-
"node": ">=
|
|
39
|
+
"node": ">=22"
|
|
40
40
|
},
|
|
41
41
|
"imports": {
|
|
42
42
|
"#avyaya": "./lib/avyaya/index.js"
|
|
@@ -47,16 +47,16 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@putout/test": "^15.1.1",
|
|
50
|
-
"c8": "^10.1.2",
|
|
51
50
|
"eslint": "^10.0.0",
|
|
52
51
|
"eslint-plugin-putout": "^31.0.0",
|
|
53
52
|
"fast-xml-parser": "^5.3.3",
|
|
54
53
|
"ipull": "^4.0.3",
|
|
55
54
|
"madrun": "^13.0.0",
|
|
56
|
-
"montag": "^
|
|
55
|
+
"montag": "^2.0.1",
|
|
57
56
|
"nodemon": "^3.0.1",
|
|
58
57
|
"redlint": "^6.0.0",
|
|
59
|
-
"
|
|
58
|
+
"superc8": "^12.7.0",
|
|
59
|
+
"supertape": "^13.2.0",
|
|
60
60
|
"try-to-catch": "^4.0.5"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|