bindu 1.7.0 → 1.7.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 +5 -0
- package/README.md +1 -2
- package/lib/sandhi/apply-vriddhi/index.js +21 -3
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/README.md
CHANGED
|
@@ -28,12 +28,11 @@ import {bindu} from 'bindu';
|
|
|
28
28
|
|
|
29
29
|
bindu('प्रतिएक');
|
|
30
30
|
// returns {code: 'प्रत्येक'}
|
|
31
|
-
|
|
32
31
|
bindu('द्रौपदी अश्वम्', {
|
|
33
32
|
type: 'iast',
|
|
34
33
|
});
|
|
35
|
-
// returns {code: 'draupadyaśvam'}
|
|
36
34
|
|
|
35
|
+
// returns {code: 'draupadyaśvam'}
|
|
37
36
|
const {places} = bindu('प्रतिएक', {
|
|
38
37
|
fix: false,
|
|
39
38
|
});
|
|
@@ -5,7 +5,9 @@ const {remove} = operator;
|
|
|
5
5
|
export const report = () => `vṛddhireci`;
|
|
6
6
|
|
|
7
7
|
export const fix = ({path, next, name, nextName}) => {
|
|
8
|
-
|
|
8
|
+
const joint = getJoint(nextName);
|
|
9
|
+
|
|
10
|
+
path.node.name = `${name}${joint}${nextName.slice(1)}`;
|
|
9
11
|
remove(next);
|
|
10
12
|
};
|
|
11
13
|
|
|
@@ -23,9 +25,12 @@ export const traverse = ({push}) => ({
|
|
|
23
25
|
.at(-1)
|
|
24
26
|
.toLowerCase();
|
|
25
27
|
|
|
26
|
-
const [first
|
|
28
|
+
const [first] = nextName;
|
|
27
29
|
|
|
28
|
-
if (last !== 'a'
|
|
30
|
+
if (last !== 'a')
|
|
31
|
+
return;
|
|
32
|
+
|
|
33
|
+
if (!/[oe]/.test(first) && !/^a[iu]/.test(nextName))
|
|
29
34
|
return;
|
|
30
35
|
|
|
31
36
|
push({
|
|
@@ -36,3 +41,16 @@ export const traverse = ({push}) => ({
|
|
|
36
41
|
});
|
|
37
42
|
},
|
|
38
43
|
});
|
|
44
|
+
|
|
45
|
+
function getJoint([first, second]) {
|
|
46
|
+
if (first === 'e')
|
|
47
|
+
return 'i';
|
|
48
|
+
|
|
49
|
+
if (second === 'i')
|
|
50
|
+
return '';
|
|
51
|
+
|
|
52
|
+
if (second === 'u')
|
|
53
|
+
return '';
|
|
54
|
+
|
|
55
|
+
return 'u';
|
|
56
|
+
}
|