MCPcopy Create free account
hub / github.com/JusperLee/Speech-Separation-Paper-Tutorial / parseCSVLine

Function parseCSVLine

src/utils/csvParser.ts:151–171  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

149
150// 解析CSV行,处理引号内的逗号
151function parseCSVLine(line: string): string[] {
152 const result: string[] = [];
153 let current = '';
154 let inQuotes = false;
155
156 for (let i = 0; i < line.length; i++) {
157 const char = line[i];
158
159 if (char === '"') {
160 inQuotes = !inQuotes;
161 } else if (char === ',' && !inQuotes) {
162 result.push(current.trim());
163 current = '';
164 } else {
165 current += char;
166 }
167 }
168
169 result.push(current.trim());
170 return result;
171}
172
173// 获取所有分类选项
174export function getCategories(models: ProcessedModelData[]) {

Callers 1

parseCSVDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected