bindu 1.8.0 → 1.8.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 CHANGED
@@ -1,3 +1,8 @@
1
+ 2025.12.15, v1.8.1
2
+
3
+ feature:
4
+ - 3e8aee4 bindu: sandhi: ayadaya: improve
5
+
1
6
  2025.12.15, v1.8.0
2
7
 
3
8
  feature:
package/README.md CHANGED
@@ -76,6 +76,57 @@ au + a → au'
76
76
  bhoati → bhavati
77
77
  ```
78
78
 
79
+ #### apply-ayadaya
80
+
81
+ ##### ए
82
+ ```
83
+ ए + अ → अय
84
+ e + a → aya
85
+
86
+ ए + इ → अयि
87
+ e + i → ayi
88
+
89
+ ए + उ → अयु
90
+ e + u → ayu
91
+
92
+ ए + ए → एय
93
+ e + e → eye
94
+
95
+ ए + ओ → एयो
96
+ e + o → eyo
97
+ ```
98
+
99
+ ##### ओ
100
+ ```
101
+ ओ + अ → अव
102
+ o + a → av
103
+
104
+ ओ + इ → अवि
105
+ o + i → avi
106
+
107
+ ओ + उ → अवु
108
+ o + u → avu
109
+ ```
110
+
111
+ ##### ऐ
112
+
113
+ ```
114
+ ऐ + अ → आय
115
+ ai + a → āya
116
+
117
+ ऐ + इ → आयि
118
+ ai + i → āyi
119
+ ```
120
+
121
+ ##### औ
122
+ ```
123
+ औ + अ → आव
124
+ au + a → āvā
125
+
126
+ औ + इ → आवि
127
+ au + i → āvi
128
+ ```
129
+
79
130
  #### apply-dirgha
80
131
 
81
132
  ```
@@ -1,4 +1,5 @@
1
1
  import {operator} from 'putout';
2
+ import {avagraha} from '../../symbols.js';
2
3
 
3
4
  const {remove} = operator;
4
5
 
@@ -7,17 +8,30 @@ export const report = () => `ayādayaḥ`;
7
8
  export const fix = ({path, next, name, nextName}) => {
8
9
  remove(next);
9
10
 
10
- if (nextName.startsWith('a')) {
11
- path.node.name = `${name}${nextName.slice(1)}`;
11
+ if (name.endsWith('au')) {
12
+ path.node.name = `${name.slice(0, -1)}Av${nextName}`;
12
13
  return;
13
14
  }
14
15
 
15
- if (nextName.startsWith('ya')) {
16
- path.node.name = `${name.slice(0, -1)}${nextName.slice(1)}`;
16
+ if (name.endsWith('ai')) {
17
+ path.node.name = `${name.slice(0, -2)}Ay${nextName}`;
17
18
  return;
18
19
  }
19
20
 
20
- path.node.name = `${name.slice(0, -1)}i${nextName.slice(1)}`;
21
+ if (name.endsWith('e')) {
22
+ if (nextName.startsWith('a')) {
23
+ path.node.name = `${name.slice(0, -1)}aye${avagraha.code}${nextName.slice(1)}`;
24
+ return;
25
+ }
26
+
27
+ path.node.name = `${name.slice(0, -1)}ay${nextName}`;
28
+ return;
29
+ }
30
+
31
+ if (name.endsWith('o')) {
32
+ path.node.name = `${name.slice(0, -1)}av${nextName}`;
33
+ return;
34
+ }
21
35
  };
22
36
 
23
37
  export const traverse = ({push}) => ({
@@ -30,10 +44,19 @@ export const traverse = ({push}) => ({
30
44
  const {name} = path.node;
31
45
  const nextName = next.node.name;
32
46
 
33
- if (!name.endsWith('ya'))
47
+ if (!/([eo]|a[iu])$/.test(name))
48
+ return;
49
+
50
+ if (name.endsWith('e') && !/^[aueio]/.test(nextName))
51
+ return;
52
+
53
+ if (name.endsWith('o') && !/^[aiu]/.test(nextName))
54
+ return;
55
+
56
+ if (name.endsWith('ai') && !/^[ai]/.test(nextName))
34
57
  return;
35
58
 
36
- if (!/^(i|a|ya)/.test(nextName))
59
+ if (name.endsWith('au') && !/^[ai]/.test(nextName))
37
60
  return;
38
61
 
39
62
  push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bindu",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Pāṇini Aṣṭādhyāyī",
5
5
  "main": "lib/bindu.js",
6
6
  "bin": {