Parcourir la source

过滤字幕中不重要的标点

vodkazi il y a 1 mois
Parent
commit
073d1f39d6
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      packages/templates/src/base/components/subtitle-bar.tsx

+ 3 - 1
packages/templates/src/base/components/subtitle-bar.tsx

@@ -106,7 +106,9 @@ export const SubtitleBar: React.FC<SubtitleBarProps> = ({
             overflow: "hidden",
           }}
         >
-          {currentSegment.words.map((w, i) => {
+          {currentSegment.words
+            .filter((w) => !/[。,!?\s]/.test(w.word))
+            .map((w, i) => {
             const isCurrent = i === currentWordIndex;
             const isPast = currentTime > w.endSeconds;
             return (