mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-20 19:04:38 +08:00
Fix m3t parser
This commit is contained in:
@@ -200,11 +200,11 @@ impl<'a> M3tParser<'a> {
|
|||||||
if line.starts_with("NAME:") {
|
if line.starts_with("NAME:") {
|
||||||
name = Some(line[5..].trim().to_string());
|
name = Some(line[5..].trim().to_string());
|
||||||
} else {
|
} else {
|
||||||
source = Some(line.to_string());
|
source = Some(line.replace("\\n", "\n"));
|
||||||
}
|
}
|
||||||
} else if line.starts_with("△") {
|
} else if line.starts_with("△") {
|
||||||
let line = line[3..].trim();
|
let line = line[3..].trim();
|
||||||
llm = Some(line.to_string());
|
llm = Some(line.replace("\\n", "\n"));
|
||||||
} else if line.starts_with("●") {
|
} else if line.starts_with("●") {
|
||||||
let message = line[3..].trim();
|
let message = line[3..].trim();
|
||||||
let source = match source.take() {
|
let source = match source.take() {
|
||||||
@@ -219,7 +219,7 @@ impl<'a> M3tParser<'a> {
|
|||||||
let m = ExtendedMessage {
|
let m = ExtendedMessage {
|
||||||
name: name.take(),
|
name: name.take(),
|
||||||
source,
|
source,
|
||||||
translated: message.to_string(),
|
translated: message.replace("\\n", "\n"),
|
||||||
llm: llm.take(),
|
llm: llm.take(),
|
||||||
};
|
};
|
||||||
messages.push(m);
|
messages.push(m);
|
||||||
|
|||||||
Reference in New Issue
Block a user