bindu 2.0.0 → 2.0.2
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 +10 -0
- package/lib/sandhi/ac/apply-purvarupa/index.js +61 -14
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -2,9 +2,40 @@ import {avyayamAsti} from '#avyaya';
|
|
|
2
2
|
|
|
3
3
|
export const report = () => `ekaḥ pūrvaparayoḥ`;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
}
|
|
8
39
|
};
|
|
9
40
|
|
|
10
41
|
export const traverse = ({push}) => ({
|
|
@@ -20,25 +51,41 @@ export const traverse = ({push}) => ({
|
|
|
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 (!/[aiufxAIU]/.test(last))
|
|
32
65
|
return;
|
|
33
66
|
|
|
34
|
-
if (
|
|
67
|
+
if (lastLow === first && DIRGHA[last]) {
|
|
68
|
+
push({
|
|
69
|
+
path,
|
|
70
|
+
next,
|
|
71
|
+
name,
|
|
72
|
+
nextName,
|
|
73
|
+
kind: 'dirgha',
|
|
74
|
+
dirgha: DIRGHA[last],
|
|
75
|
+
});
|
|
35
76
|
return;
|
|
77
|
+
}
|
|
36
78
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
79
|
+
if (YAN[last] && /[aie]/.test(first)) {
|
|
80
|
+
push({
|
|
81
|
+
path,
|
|
82
|
+
next,
|
|
83
|
+
name,
|
|
84
|
+
nextName,
|
|
85
|
+
kind: 'yan',
|
|
86
|
+
yan: YAN[last],
|
|
87
|
+
});
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
43
90
|
},
|
|
44
91
|
});
|