kanji koohii FORUM
Is there a program to put spaces in Japanese Sentences? - Printable Version

+- kanji koohii FORUM (http://forum.koohii.com)
+-- Forum: Learning Japanese (http://forum.koohii.com/forum-4.html)
+--- Forum: Learning resources (http://forum.koohii.com/forum-9.html)
+--- Thread: Is there a program to put spaces in Japanese Sentences? (/thread-8016.html)

Pages: 1 2


Is there a program to put spaces in Japanese Sentences? - nest0r - 2011-06-29

I don't think the text size matters, but I'm sure the amount of the text's morphemes we're matching does. So for your purposes I think it works.

It seems to use a combination of factors, including the longest. I had just Googled it (and found a variation for English using word boundaries) and experimented and it worked well for my purposes of finding unknowns and adding visual formatting, especially as I felt the conditions of what types of words would be unknown for most users (edit: their role as function words), the contiguity of morphemes, and Rikaisan's dictionary segmentation would take care of any rare errors.

The spaces thing was incidental but I thought I'd share in this thread. ;p


Is there a program to put spaces in Japanese Sentences? - lauri_ranta - 2013-01-15

If other OS X users run into the errors mentioned earlier, try installing mecab with Homebrew:

brew install mecab mecab-ipadic

-O wakati also adds spaces around punctuation characters:

$ mecab -O wakati <<< 設定を変更するには、以下の手順に従ってください。
設定 を 変更 する に は 、 以下 の 手順 に 従っ て ください 。

I haven't come up with anything better than this:

$ mecab -F '%m ' -E '\n' <<< 設定を変更するには、以下の手順に従ってください。 | sed -E 's/ ?([、。「」『』]) ?/\1/g'
設定 を 変更 する に は、以下 の 手順 に 従っ て ください。

-F %m = format morpheme. See http://mecab.googlecode.com/svn/trunk/mecab/doc/format.html.


Is there a program to put spaces in Japanese Sentences? - Nukemarine - 2013-01-15

Sounds like a good application to use this Speed Reading Trainer with Japanese. It won't work with normal Japanese text since it thinks long sentences are one word. Adding spaces make that a non-issue.


Is there a program to put spaces in Japanese Sentences? - aldebrn - 2014-09-17

lauri_ranta Wrote:If other OS X users run into the errors mentioned earlier, try installing mecab with Homebrew:

brew install mecab mecab-ipadic

-O wakati also adds spaces around punctuation characters
I was shocked that Control-F "wakati" didn't turn up anything on the first page of this thread. Yes, "mecab -O wakati" will do this for you.

You can now also try it without installing anything on your computer: try MeCab on the web, in your browser: http://fasiha.github.io/mecab-emscripten/ paste your text (or just use the default text that's already there to see how it works), type in "-O wakati" for the flags (without quotes!), and submit.