bindu 1.9.0 → 1.11.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 +13 -10
- package/dictionary/stems.json +469353 -0
- package/dictionary/stems.json.gz +0 -0
- package/lib/pratipadika.js +5 -0
- package/lib/pratyahara.js +30 -3
- package/lib/sandhi/ac/apply-eco-yavayava/index.js +74 -0
- package/lib/sandhi/ac/index.js +2 -0
- package/lib/sandhi/visarga/apply-kharovasana/index.js +35 -0
- package/lib/sandhi/visarga/index.js +2 -0
- package/package.json +7 -7
|
Binary file
|
package/lib/pratyahara.js
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const ec = [
|
|
2
|
+
'e',
|
|
3
|
+
'o',
|
|
4
|
+
'ai',
|
|
5
|
+
'au',
|
|
6
|
+
];
|
|
7
|
+
const ac = [
|
|
8
|
+
'a',
|
|
9
|
+
'i',
|
|
10
|
+
'u',
|
|
11
|
+
'f',
|
|
12
|
+
'x',
|
|
13
|
+
...ec,
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const khar = [
|
|
17
|
+
'k',
|
|
18
|
+
'c',
|
|
19
|
+
'w',
|
|
20
|
+
't',
|
|
21
|
+
'p',
|
|
22
|
+
'z',
|
|
23
|
+
's',
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const createAsti = (a) => (b) => a.includes(b.toLowerCase());
|
|
27
|
+
|
|
28
|
+
export const astiAc = createAsti(ac);
|
|
29
|
+
export const astiEc = createAsti(ec);
|
|
30
|
+
export const astiKhar = createAsti(khar);
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {operator} from 'putout';
|
|
2
|
+
import {astiAc, astiEc} from '../../../pratyahara.js';
|
|
3
|
+
import {praptaPratapadika} from '../../../pratipadika.js';
|
|
4
|
+
|
|
5
|
+
const {remove} = operator;
|
|
6
|
+
|
|
7
|
+
export const report = () => `eco yavāyāvaḥ`;
|
|
8
|
+
|
|
9
|
+
export const fix = ({path, next, name, nextName}) => {
|
|
10
|
+
if (name.endsWith('e')) {
|
|
11
|
+
path.node.name = `${name.slice(0, -1)}ay${nextName}`;
|
|
12
|
+
remove(next);
|
|
13
|
+
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (name.endsWith('o')) {
|
|
18
|
+
path.node.name = `${name.slice(0, -1)}av${nextName}`;
|
|
19
|
+
remove(next);
|
|
20
|
+
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (name.endsWith('ai')) {
|
|
25
|
+
path.node.name = `${name.slice(0, -1)}Ay${nextName}`;
|
|
26
|
+
remove(next);
|
|
27
|
+
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (name.endsWith('au')) {
|
|
32
|
+
path.node.name = `${name.slice(0, -1)}Av${nextName}`;
|
|
33
|
+
remove(next);
|
|
34
|
+
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const traverse = ({push}) => ({
|
|
40
|
+
Identifier(path) {
|
|
41
|
+
const next = path.getNextSibling();
|
|
42
|
+
|
|
43
|
+
if (!next.node)
|
|
44
|
+
return;
|
|
45
|
+
|
|
46
|
+
const {name} = path.node;
|
|
47
|
+
|
|
48
|
+
const nextName = next.node.name;
|
|
49
|
+
const first = nextName.at(0);
|
|
50
|
+
const last = name.at(-1);
|
|
51
|
+
const preLast = name.at(-2);
|
|
52
|
+
|
|
53
|
+
if (!astiEc(last) && !astiEc(preLast + last))
|
|
54
|
+
return;
|
|
55
|
+
|
|
56
|
+
if (!astiAc(first))
|
|
57
|
+
return;
|
|
58
|
+
|
|
59
|
+
if (first === 'e' && first === last)
|
|
60
|
+
return;
|
|
61
|
+
|
|
62
|
+
const stem = praptaPratapadika(name);
|
|
63
|
+
|
|
64
|
+
if (stem && stem !== name)
|
|
65
|
+
return;
|
|
66
|
+
|
|
67
|
+
push({
|
|
68
|
+
path,
|
|
69
|
+
next,
|
|
70
|
+
name,
|
|
71
|
+
nextName,
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
});
|
package/lib/sandhi/ac/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as applyEcoYavayava from './apply-eco-yavayava/index.js';
|
|
1
2
|
import * as applyPadantad from './apply-padantad/index.js';
|
|
2
3
|
import * as applyAyadaya from './apply-ayadaya/index.js';
|
|
3
4
|
import * as applyPurvarupa from './apply-purvarupa/index.js';
|
|
@@ -14,4 +15,5 @@ export const rules = {
|
|
|
14
15
|
'apply-purvarupa': applyPurvarupa,
|
|
15
16
|
'apply-ayadaya': applyAyadaya,
|
|
16
17
|
'apply-padantad': applyPadantad,
|
|
18
|
+
'apply-eco-yavayava': applyEcoYavayava,
|
|
17
19
|
};
|
|
@@ -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
|
+
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import * as applyKharovasana from './apply-kharovasana/index.js';
|
|
1
2
|
import * as applyBhobhago from './apply-bhobhago/index.js';
|
|
2
3
|
import * as applyRori from './apply-rori/index.js';
|
|
3
4
|
|
|
4
5
|
export const rules = {
|
|
5
6
|
'apply-bhobhago': applyBhobhago,
|
|
6
7
|
'apply-rori': applyRori,
|
|
8
|
+
'apply-kharovasana': applyKharovasana,
|
|
7
9
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bindu",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Pāṇini Aṣṭādhyāyī",
|
|
5
5
|
"main": "lib/bindu.js",
|
|
6
6
|
"bin": {
|
|
@@ -9,19 +9,16 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "madrun lint",
|
|
12
|
-
"fresh:lint": "madrun fresh:lint",
|
|
13
|
-
"lint:fresh": "madrun lint:fresh",
|
|
14
12
|
"fix:lint": "madrun fix:lint",
|
|
15
13
|
"test": "madrun test",
|
|
16
|
-
"test:mock": "madrun test:mock",
|
|
17
14
|
"watch:test": "madrun watch:test",
|
|
18
15
|
"watch:tape": "madrun watch:tape",
|
|
19
16
|
"watch:lint": "madrun watch:lint",
|
|
20
17
|
"watcher": "madrun watcher",
|
|
21
18
|
"coverage": "madrun coverage",
|
|
22
|
-
"coverage:es": "madrun coverage:es",
|
|
23
19
|
"report": "madrun report",
|
|
24
|
-
"wisdom": "madrun wisdom"
|
|
20
|
+
"wisdom": "madrun wisdom",
|
|
21
|
+
"extract": "madrun extract"
|
|
25
22
|
},
|
|
26
23
|
"repository": {
|
|
27
24
|
"type": "git",
|
|
@@ -55,11 +52,14 @@
|
|
|
55
52
|
"c8": "^10.1.2",
|
|
56
53
|
"eslint": "^9.0.0",
|
|
57
54
|
"eslint-plugin-putout": "^29.0.2",
|
|
55
|
+
"fast-xml-parser": "^5.3.3",
|
|
56
|
+
"ipull": "^4.0.3",
|
|
58
57
|
"madrun": "^11.0.0",
|
|
59
58
|
"montag": "^1.2.1",
|
|
60
59
|
"nodemon": "^3.0.1",
|
|
61
60
|
"redlint": "^4.0.0",
|
|
62
|
-
"supertape": "^11.1.0"
|
|
61
|
+
"supertape": "^11.1.0",
|
|
62
|
+
"try-to-catch": "^3.0.1"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|