Skip to content

Commit 47d888e

Browse files
committed
Simplify input data for IPASkeleton.test.ts
- Parse TSV data without headers and use directly in `IPASkeleton`
1 parent ccfaa70 commit 47d888e

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/pheatures/IPASkeleton.test.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
import { expect, test } from "vitest";
22

33
import consonantChartsPath from "@/assets/data/ipa-chart/ipachart-consonants.tsv";
4+
import parseFile from "@/utils/dataTransformer";
45

56
import ComplexSymbol from "./ComplexSymbol";
67
import { diacriticList } from "./Diacritics";
78
import IPASkeleton from "./IPASkeleton";
8-
import symbolList from "./SymbolList.test";
9-
import parseFile from "@/utils/dataTransformer";
109

11-
const consonantsChart = parseFile<Record<string, string>>(consonantChartsPath, true);
10+
import symbolList from "./SymbolList.test";
1211

13-
// unwrap headers provided by dataTransformer
14-
const rawConsonants = [Array.from(Object.keys(consonantsChart[0]))].concat(
15-
consonantsChart.map(Object.values)
16-
);
17-
const skeleton = new IPASkeleton(rawConsonants, symbolList);
12+
const consonantsChart = parseFile<string[]>(consonantChartsPath, false);
13+
const skeleton = new IPASkeleton(consonantsChart, symbolList);
1814

1915
test("finds reasonable base candidate: aspirated backed velar plosive", async () => {
2016
const symbol = ComplexSymbol.fromBaseSymbol(symbolList.symbols["k"], [

0 commit comments

Comments
 (0)