Skip to content

Commit c3f3f37

Browse files
committed
fixes
1 parent 9463b7b commit c3f3f37

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

lib/aggregate/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ export default async function aggregate(dbPath, outPath = `out.ndjson`) {
294294
let entries = await readNDJSON(dbPath);
295295

296296
entries = entries.filter(entry => {
297-
if (!entry.dataSources.CW) return true;
297+
if (!entry.dataSources.CW) return false;
298298
return entry.dataSources.CW.dialects.includes(`plai1258`);
299299
});
300300

lib/import/CW-sources.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ export default async function importCWSources(sourcesPath, toolboxPath, outPath
9696
for (const entry of originalEntries) {
9797

9898
const originalStem = entry.head
99-
.replace(/^-/u, ``) // remove leading hyphen
100-
.replace(/-$/u, ``) // remove trailing hyphen
101-
.replace(/Y/gu, `ý`);
99+
.replace(/^-/u, ``) // remove leading hyphen
100+
.replace(/-$/u, ``) // remove trailing hyphen
101+
.replace(/Y/gu, `y`); // normalize historical /ý/
102102

103103
const converted = [originalStem];
104104
const dependent = [];
@@ -161,10 +161,12 @@ export default async function importCWSources(sourcesPath, toolboxPath, outPath
161161

162162
// NA
163163
// - remove postconsonantal final /w/
164-
// - add final /a/ (NA-4, NA-4w)
164+
// - add final -a (NA-4, NA-4w)
165+
// - add final -ak (NA-3)
165166
if (entry.POS === `NA`) {
166167
if (wFinalRegExp.test(originalStem)) converted.push(originalStem.replace(/w$/u, ``));
167168
converted.push(`${ originalStem }a`);
169+
converted.push(`${ originalStem }ak`);
168170
continue;
169171
}
170172

@@ -256,15 +258,16 @@ export default async function importCWSources(sourcesPath, toolboxPath, outPath
256258

257259
for (const currentEntry of toolboxEntries) {
258260

259-
const existingEntry = index.get(currentEntry.sro);
261+
const normalizedHead = currentEntry.sro.replace(/ý/gu, `y`); // normalize historical /ý/
262+
const existingEntry = index.get(normalizedHead);
260263

261264
if (existingEntry) {
262265
if (Array.isArray(existingEntry)) existingEntry.push(currentEntry);
263-
else index.set(currentEntry.sro, [existingEntry, currentEntry]);
266+
else index.set(normalizedHead, [existingEntry, currentEntry]);
264267
continue;
265268
}
266269

267-
index.set(currentEntry.sro, currentEntry);
270+
index.set(normalizedHead, currentEntry);
268271

269272
}
270273

0 commit comments

Comments
 (0)