Skip to content

Commit

Permalink
Merge pull request #11 from AliceNovel/dev
Browse files Browse the repository at this point in the history
Added: emotion support
  • Loading branch information
Lemon73-Computing authored Apr 9, 2024
2 parents c6f861c + ed9b7e8 commit f3a6e99
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
34 changes: 32 additions & 2 deletions AnovSyntax/Anov.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,40 @@ public static void Read(string str)
{
Match match;

// Read "- people-name"
match = Regex.Match(str, @"- (.*)");
// Unsupported
// Read "> place"
match = Regex.Match(str, @"> (.*)");
if (match.Success)
Console.WriteLine("<place>");

// Unsupported
// Read "bgm: background-music"
match = Regex.Match(str, @"bgm: (.*)");
if (match.Success)
Console.WriteLine("<bgm>");

// Unsupported
// Read "movie: movie"
match = Regex.Match(str, @"movie: (.*)");
if (match.Success)
Console.WriteLine("<movie>");

// Read "- people-name / emotion"
match = Regex.Match(str, @"- (.*?)/");
if (match.Success)
Console.Write(match.Groups[1].Value.Trim());
else
{
// Read "- people-name"
match = Regex.Match(str, @"- (.*)");
if (match.Success)
Console.Write(match.Groups[1].Value.Trim());
}

// Read "/ emotion"
match = Regex.Match(str, @"/ (.*)");
if (match.Success)
Console.Write(" (" + match.Groups[1].Value.Trim() + ")");

// Read "[conversatioc-content]"
match = Regex.Match(str, @"\[(.*?)\]");
Expand Down
2 changes: 1 addition & 1 deletion Sample/sample.anov
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- Alice
- Alice / happy
[Hello everyone!!]

- Bob
Expand Down

0 comments on commit f3a6e99

Please sign in to comment.