If I type 全ては必然 in jisho.org, it spits out "すべてはひつぜん", as expected. (So it
reads 必 as _hitsu_ , and keeps the particle は as written.)

If I type 必ずたどり着くから, it spits out "かならずたどりつくから", as expected. (So it reads 必
as _kanara.zu_ )

How does the dictionary know which pronunciation of 必 is correct in context?
CC BY-SA 4.0
2020-05-04T06:37:28.310
77043
2020-05-04T15:21:31.810
38825
question
dictionary
How do online dictionaries find the correct pronunciation of kanji in context?
Do you use a Japanese IME? It can convert hiragana to ordinary mixed-kanji-
kana sentences, although it sometimes make mistakes. Jisho.org does a similar
thing, but in the opposite direction.

This can be achieved by programs called _morphological analyzers_.
[MeCab](https://en.wikipedia.org/wiki/MeCab) is one of the best-known, but
there are other open-source software. The technical details are beyond the
scope of this site, but this is a technically challenging problem, and recent
ones generally use large dictionaries and machine learning. Here's an example
output of [kuromoji](https://www.atilika.org/):

[![An example output from
kuromoji](https://i.stack.imgur.com/XYCXg.png)](https://i.stack.imgur.com/XYCXg.png)

There are a few words that are read differently in different contexts. For
example, 人気 is read either ひとけ or にんき depending on the context. (English also
has the same problem; _read_ , _wind_ and _minute_ have multiple possible
readings.) Recent good morphological analyzers may handle even cases like
this, but the one implemented in jisho.org does not seem to be smart enough to
me.

See also:

  * [Wikipedia: Text Segmentation](https://en.wikipedia.org/wiki/Text_segmentation)
  * [Is it possible to algorithmically convert Japanese text to Romaji?](https://japanese.stackexchange.com/q/56640/5010)
CC BY-SA 4.0
2020-05-04T07:30:11.640
77044
2020-05-04T15:21:31.810
2020-05-04T15:21:31.810
5010
5010
77043
answer