Skip to content

Commit

Permalink
Remove extra new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
ce-nistal committed Aug 30, 2024
1 parent d88bd60 commit d9f1b13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Apps.AzueOpenAI/Actions/XliffActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ private string GetSystemPrompt(bool translator)
var index = translatedText.LastIndexOf("\",") == -1 ? translatedText.LastIndexOf("\"\n,") : translatedText.LastIndexOf("\",");
index = index == -1 ? translatedText.LastIndexOf("\n\",") == -1? translatedText.LastIndexOf("\\n\",") : translatedText.LastIndexOf("\n\",") : index;
filteredText = translatedText.Remove(index) + "\"]";
}
filteredText = filteredText.Replace("\\n", "").Replace("\n","");
}
filteredText = Regex.Match(filteredText, "\\[[\\s\\S]+\\]").Value;
var result = JsonConvert.DeserializeObject<string[]>(filteredText);

Expand Down

0 comments on commit d9f1b13

Please sign in to comment.