fix dash mark in transcript
This commit is contained in:
@@ -193,22 +193,26 @@ const SelectedTabContent = (props: {
|
||||
<div className="font-serif text-lg font-semibold tracking-tight">
|
||||
{word.text}
|
||||
</div>
|
||||
<div className="text-sm text-serif text-muted-foreground">
|
||||
<span
|
||||
className={`mr-2 font-code ${i === 0 ? "before:content-['/']" : ""
|
||||
}
|
||||
{
|
||||
word.timeline.length > 0 && (
|
||||
<div className="text-sm text-serif text-muted-foreground">
|
||||
<span
|
||||
className={`mr-2 font-code ${i === 0 ? "before:content-['/']" : ""
|
||||
}
|
||||
${i === selectedIndices.length - 1
|
||||
? "after:content-['/']"
|
||||
: ""
|
||||
}`}
|
||||
>
|
||||
{word.timeline
|
||||
.map((t) =>
|
||||
t.timeline.map((s) => convertIpaToNormal(s.text)).join("")
|
||||
)
|
||||
.join("")}
|
||||
</span>
|
||||
</div>
|
||||
? "after:content-['/']"
|
||||
: ""
|
||||
}`}
|
||||
>
|
||||
{word.timeline
|
||||
.map((t) =>
|
||||
t.timeline.map((s) => convertIpaToNormal(s.text)).join("")
|
||||
)
|
||||
.join("")}
|
||||
</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -118,6 +118,17 @@ export const useTranscriptions = (media: AudioType | VideoType) => {
|
||||
const match = word?.match(/-|%/);
|
||||
if (!match) return;
|
||||
|
||||
if (word === '-') {
|
||||
sentence.timeline.splice(j, 0, {
|
||||
type: 'token',
|
||||
text: '-',
|
||||
startTime: sentence.timeline[j - 1].endTime,
|
||||
endTime: token.startTime,
|
||||
timeline: [],
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
for (let k = j + 1; k <= sentence.timeline.length - 1; k++) {
|
||||
if (word.includes(sentence.timeline[k].text.toLowerCase())) {
|
||||
let connector = "";
|
||||
|
||||
Reference in New Issue
Block a user