Incorrect newline characters breaking JSON parsing
- 主要語言
- TypeScript
- 星號
- 286
- 分支
- 151
- PR 合併指標
- 30 天內沒有已合併 PR
描述
See https://github.com/3b1b/captions/blob/main/2023/gaussian-integral/hebrew/sentence_translations.json#L774
I think this is the AI model trying to translate a `\n` newline character, and using a Hebrew "n" instead, which is not a valid JSON escape character. So, parsing fails, and going to that lesson page shows that the captions file is missing (I could improve the message to discriminate between loading errors and parsing errors).
It'd be hard to make the app recover from this type of parsing error though. I could replace all `\מ`s with `\n`s, but what about other languages and escape characters? Perhaps a better solution here would be to make sure these characters are removed from the input English _before_ passing them to the models. Could more easily make sure all escape characters are captured that way.
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
該 issue 指向一個特定的 JSON 檔案(2023/gaussian-integral/hebrew/sentence_translations.json),其中一個希伯來字符正在破壞解析。查看 codebase 中 caption 檔案是如何載入和解析的。任務是找出英文文本傳送到翻譯模型的地方,並確保像 '\n' 這樣的跳脫字元在翻譯前被保留或清理。檢查是否有現有的驗證或清理邏輯。修正將涉及更新前處理步驟並驗證 JSON 檔案是否正確解析。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- json, typescript
- 領域
- content, internationalization
- Issue 類型
- 缺陷
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100