Cutano / Kawazu

A C# library for converting Japanese sentence to Hiragana, Katakana or Romaji with furigana and okurigana modes supported. Inspired by project Kuroshiro.
MIT License
55 stars 15 forks source link

One or more errors occurred. (Index was outside the bounds of the array.) #10

Closed lasyan3 closed 3 years ago

lasyan3 commented 3 years ago

Hi, First thanks for the great work with Kawazu, very heplful! But sometimes it generates an exception. Step to reproduce :

var converter = new KawazuConverter();
var inputH = converter.Convert("だれでうどうんづしますか", To.Hiragana, Mode.Normal).Result;

Stacktrace:

   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 Kawazu.KawazuConverter.<>c__DisplayClass6_0.<Convert>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Kawazu.KawazuConverter.<Convert>d__6.MoveNext()
lasyan3 commented 3 years ago

Using the nuget package. When referencing the code directly into my asp.net project, it seems there are no more errors.

ookii-tsuki commented 3 years ago

Hey @Cutano could you pack the last merged pull request where we fixed this error into a nuget package

Cutano commented 3 years ago

Hey @Cutano could you pack the last merged pull request where we fixed this error into a nuget package

I'm sorry I didn't check my mailbox. But this issue seems to be a new one, for I ran the code above and got the same error as @lasyan3 said. I'm still debugging it, once I find the reason I'll let you guys know :) Lol I didn't update my test project's Nuget package either, you are right @ookii-tsuki I forgot to upload the new Nuget package.

Cutano commented 3 years ago

Package uploaded but has not been indexed yet, it will become available after Nuget indexed.