정답: 가수가 제목 정답에 섞이던 것·틀린 한글 발음 정답 고치기 (docs 13)

- 퀴즈 편집 화면: '추가 정답' 한 칸을 '제목 정답'·'가수 정답' 두 칸으로
- 괄호 안이 그 곡 가수 이름이면 제목 정답이 아님: cleanTitle(title, artist) — Crank That (Soulja Boy), 레이 (LAY). 정답 생성·플레이리스트·파일 읽기 모두 가수를 넘김
- 재생목록으로 엑셀 만들기: 정답·가수 정답 칸에 제목·가수를 다시 적지 않음(다른 표기만)
- 한글 발음 정답은 검수한 표기표(answers/lexicon.json: 단어 2,299·제목 74·가수 이름 1,111, 띄어 쓴 꼴과 붙여 쓴 꼴)만. 표기표에 없는 단어가 있으면 발음 정답 없이 unknownWords → 새 곡은 '확인 필요'(발음 확인 필요: …), 관리자 → 제목 정리에서 제목/가수 정답을 더해 적용. 규칙 읽기(en-ko.ts)는 후보·옛 정답 찾기에만
- cli redo-readings [--dry-run] [--old-lexicon]: 옛 규칙(이나 이전 표기표)이 만든 발음 정답만 빼고 표기표 표기로 — DB 별칭(source auto)과 일반 퀴즈 정답, 관리자 별칭·직접 쓴 정답·이지선다는 그대로. cli lexicon-missing: 표기표에 없는 단어와 규칙 후보
- 멜론 차트: 재생이 막힌 곡은 제목 칸에 링크가 없어 가수 링크를 제목으로 읽던 것 → 제목 칸만 읽음. cli fix-melon-titles: 제목이 가수 이름인 멜론 곡을 곡 정보 페이지 제목으로(자기 이름 곡은 그대로), 같은 곡이 이미 있으면 합침, 잘못 찾은 후보 영상은 원곡 찾기로
- decodeEntities: é·° 등(Céline Dion)
- 가수 칸의 따옴표 안을 with로 자르지 않음('Miki Matsubara Official "stay with me"' → 가수 정답 '미')
- 테스트: 표기표 읽기(사용자가 짚은 10곡 포함), 확인 필요로 보내기·정답 더해 적용, 발음 정답 바꾸기(DB·퀴즈·이지선다 제외·이전 표기표), 멜론 제목 칸·곡명·fix-melon-titles, 가수 괄호, 엑셀 칸; e2e quiz(재생목록 엑셀 칸)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-11-04 20:44:05 +09:00
parent 9a07b9978d
commit b360ff0eb7
24 changed files with 4166 additions and 54 deletions

View File

@@ -646,8 +646,8 @@ function SongsTab({
<th style={{ width: 28 }} aria-label="순서 옮기기" />
<th style={{ width: 44 }}>번호</th>
<th>노래</th>
<th>{duel ? '조회수' : '추가 정답'}</th>
{duel && <th>비고</th>}
<th>{duel ? '조회수' : '제목 정답'}</th>
<th>{duel ? '비고' : '가수 정답'}</th>
<th>길이</th>
<th>재생 위치</th>
<th style={{ width: 120 }} />
@@ -699,7 +699,10 @@ function SongsTab({
<td className="small">{duelViewsNote(it) ?? <span className="muted">-</span>}</td>
</>
) : (
<td className="small">{[...it.titleAnswers, ...it.artistAnswers].join(', ') || <span className="muted">-</span>}</td>
<>
<td className="small">{it.titleAnswers.join(', ') || <span className="muted">-</span>}</td>
<td className="small">{it.artistAnswers.join(', ') || <span className="muted">-</span>}</td>
</>
)}
<td className="mono small">{mmss(it.durationSec ?? (it.songId ? db[it.songId]?.durationSec : null))}</td>
<td className="small">{it.auto ? <span className="muted">자동</span> : `처음 ${mmss(it.startSec ?? 0)} · 하이라이트 ${mmss(it.highlightSec)}`}</td>

View File

@@ -35,7 +35,8 @@ export function TitleReviewsPage() {
const [page, setPage] = useState(0);
const [data, setData] = useState<ListResp | null>(null);
const [pick, setPick] = useState<Set<number>>(new Set());
const [edits, setEdits] = useState<Record<number, { title?: string; artist?: string }>>({});
// addTitle / addArtist: answers typed by the admin (a reading the 한글 표기표 lacked), comma separated
const [edits, setEdits] = useState<Record<number, { title?: string; artist?: string; addTitle?: string; addArtist?: string }>>({});
const [busy, setBusy] = useState(false);
const [confirmAll, setConfirmAll] = useState(false);
const load = useCallback(() => {
@@ -63,7 +64,14 @@ export function TitleReviewsPage() {
};
const rows = data?.rows ?? [];
const chosen = [...pick];
const editList = (ids: number[]) => ids.filter((id) => edits[id]).map((id) => ({ id, ...edits[id] }));
const split = (s: string | undefined) => (s ?? '').split(',').map((x) => x.trim()).filter(Boolean);
const editList = (ids: number[]) =>
ids
.filter((id) => edits[id])
.map((id) => {
const { addTitle, addArtist, ...names } = edits[id]!;
return { id, ...names, titleAnswers: split(addTitle), artistAnswers: split(addArtist) };
});
const label = (k: Kind) => data?.kinds.find((x) => x.id === k)?.label ?? k;
const pages = Math.ceil((data?.total ?? 0) / 100);
return (
@@ -177,7 +185,25 @@ export function TitleReviewsPage() {
<td className="small">
{r.titleAnswers.length > 0 && <div>제목: {r.titleAnswers.join(', ')}</div>}
{r.artistAnswers.length > 0 && <div className="muted">가수: {r.artistAnswers.join(', ')}</div>}
{!r.titleAnswers.length && !r.artistAnswers.length && <span className="muted">-</span>}
{!r.titleAnswers.length && !r.artistAnswers.length && r.kind !== 'check' && <span className="muted">-</span>}
{!done && r.kind === 'check' && (
<div className="stack" style={{ gap: 4, marginTop: 4, minWidth: 200 }}>
<input
className="input sm"
aria-label={`${r.oldTitle} 제목 정답 더하기`}
placeholder="제목 정답 더하기 (,로 구분)"
value={edits[r.songId]?.addTitle ?? ''}
onChange={(e) => setEdits((cur) => ({ ...cur, [r.songId]: { ...cur[r.songId], addTitle: e.target.value } }))}
/>
<input
className="input sm"
aria-label={`${r.oldTitle} 가수 정답 더하기`}
placeholder="가수 정답 더하기 (,로 구분)"
value={edits[r.songId]?.addArtist ?? ''}
onChange={(e) => setEdits((cur) => ({ ...cur, [r.songId]: { ...cur[r.songId], addArtist: e.target.value } }))}
/>
</div>
)}
</td>
<td className="small">
{done ? (