Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This appears to be a simpler problem than LCS, because each string of hiragana in the sentence <em>must</em> appear in the pronunciation.</p> <p>Let us call a string of hiragana in the sentence an "h-string".</p> <p>If an h-string in the sentence matches <em>only one</em> substring in the pronunciation, then we can split the problem. For example, this:</p> <p>[小*<em>さくとも</em>*健気で美しい月が] &lt;=> [しょう*<em>さくとも</em>*けなげでびしいつきが]</p> <p>becomes this:</p> <p>[小] &lt;=> [しょう]<br> [健気で美しい月が] &lt;=> [けなげでびしいつきが]</p> <p>In this example, this process is sufficient because there is no ambiguity; each h-string appears only once in the pronunciation. We must consider more difficult cases.</p> <p>I will replace sequences of hiragana and kanji with roman characters, partly for abstraction, but mainly because I do not speak Japanese and cannot concoct real Japanese sentences as examples. The previous example becomes:</p> <p>[AwBCxDyEz] &lt;=> [swtxuyvz]</p> <p>This breaks down easily:<br> A:s<br> BC:t<br> D:u<br> E:v<br></p> <p>This process will work until we encounter a map in which all h-strings are internal and none is unique in the pronunciation:</p> <p>[AyBzC] &lt;=> [yuzyvzyzwzyx]</p> <p>Now we must consider all possible matches:</p> <p>[yuz<b>y</b>v<b>z</b>yzwzyx]<br> [yuz<b>y</b>vzy<b>z</b>wzyx]<br> [yuz<b>y</b>vzyzw<b>z</b>yx]<br> [yuzyvz<b>y</b>zw<b>z</b>yx]<br></p> <p>In this case the algorithm must report 4 possible pronunciation of {A, B, C}.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload