Skip to content

Commit

Permalink
Change algorithm to let romaji more understandable.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Dec 21, 2020
1 parent f849aa6 commit e982879
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Linq;
using NUnit.Framework;
using osu.Game.Rulesets.Karaoke.Edit.Generator.RomajiTags.Ja;
using osu.Game.Rulesets.Karaoke.Objects;
Expand All @@ -14,6 +13,7 @@ public class JaRomajiTagGeneratorTest
{
[TestCase("花火大会", new[] { "[0,2]:hanabi", "[2,4]:taikai" })]
[TestCase("はなび", new string[] { "[0,3]:hanabi" })]
[TestCase("枯れた世界に輝く", new[] { "[0,3]:kareta", "[3,6]:sekaini", "[6,8]:kagayaku" })]
public void TestCreateRomajiTags(string text, string[] actualRomaji)
{
var config = generatorConfig(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ public override RomajiTag[] CreateRomajiTags(Lyric lyric)
// conbine romajies of they are not from kanji.
var previousProcessingTag = processingTags.GetPrevious(processingTag);
var fromKanji = processingTag.FromKanji;
var previousFromKanji = previousProcessingTag?.FromKanji ?? true;
if (!fromKanji && !previousFromKanji)
if (previousProcessingTag != null && !fromKanji)
{
var combinedRomajiTag = TextTagsUtils.Combine(previousProcessingTag.RomajiTag, processingTag.RomajiTag);
romajiTags.Remove(previousProcessingTag.RomajiTag);
Expand Down

0 comments on commit e982879

Please sign in to comment.