Skip to content

Errors in transliterations #16

@seertenedos

Description

@seertenedos

I could be doing things incorrectly but i am trying to basically do 2 things given almost any imput in a japanese text field.

  1. Convert to Kana
  2. Convert to Romaji

The Romaji conversion is thowing a heap of erorrs most of the time like the one below from a unit test.

        [Theory]
        [InlineData("袖ケ浦港運", "Sodegaura-kō un")]
        public async Task RomajiTransliterationTest(string input, string expectedOutput)
        {
            KawazuConverter converter = new();
            var output = await converter.Convert(input, To.Romaji, Mode.Okurigana, RomajiSystem.Hepburn);
            Assert.Equal(expectedOutput, output);
        }
System.ArgumentOutOfRangeException: Length cannot be less than zero. (Parameter 'length')
   at System.Text.StringBuilder.ToString(Int32 startIndex, Int32 length)
   at Kawazu.Division..ctor(MeCabIpaDicNode node, TextType type, RomajiSystem system)
   at Kawazu.KawazuConverter.<>c__DisplayClass6_0.<Convert>b__1(MeCabIpaDicNode node)
   at System.Linq.Enumerable.SelectArrayIterator`2.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Kawazu.KawazuConverter.<>c__DisplayClass6_0.<Convert>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions