Closed Bug 933252 Opened 11 years ago Closed 11 years ago

jp-kanji keyboard doesn't work

Categories

(Firefox OS Graveyard :: Gaia::Keyboard, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: masashi.honma, Assigned: lchang)

References

Details

Attachments

(1 file)

I build Japanese input environment by refering "Building multilocale" section in this site.
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Building

And I enable Japanese keyboard by this command.
$ GAIA_KEYBOARD_LAYOUTS=en,jp-kanji make install-gaia
I could see Japanese keyboard.

I tapped the "あ" key. But no charcter appeared on the input field and IME window.

I expect "あ" will appear on IME window.

I could see a message below in "adb logcat"

E/GeckoConsole(  713): [JavaScript Error: "NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [inIDOMUtils.setContentState]" {file: "chrome://global/content/BrowserElementPanning.js" line: 510}]
timdream,

I will develop third party IME for Japanese on the new KeyboardIME API.

But currently Japanese keyboard doesn't work.

Is there any advice ?
Hi Masashi,

Thanks for your interest in contributing to Firefox OS.
We removed the Japanese dictionary in Bug 808849, but the code is still there, in [Gaia]:apps/keyboard/js/imes/jskanji/

It would be highly recommended if you could take a look at those parts with some guidelines in this doc,
https://wiki.mozilla.org/Gaia/System/Keyboard/Layout

We will come out with a detailed document on how to create 3rd-party IME app, but that is still a work-in-progress, so feel free to ask questions here or on IRC.

Thanks.
Hi Masashi,

Do you want to work on this bug?
I can help to let you know how to get the removed dictionary back and maybe we can start looking into how to improve the performance.

Thanks.
Flags: needinfo?(masashi.honma)
I think this is not a dictionary problem. I already expand IPA dictionary by typing 'make'.

I can not just input any character via keyboard. I think this is a keyboard problem.
Flags: needinfo?(masashi.honma)
I mean dictionary in B2G/gaia/apps/keyboard/js/imes/jskanji.

Not B2G/gaia/keyboard/dictionaries.
We haven't maintained jskanji for some time. The keyboard framework changes a lot, but isn't synced to the jskanji. So even you get the dictionary, you cannot run the kanji keyboard.

Would you like to work on the kanji keyboard? I may fix up it for you. But keyboard's performance is poor and you need to rewrite the kanji dictionary engine to speed it up. A practical way, which has been applied to jspinyin, is to convert a C/C++ engine to js with emscripten(https://github.com/kripken/emscripten). The converted engine will almost run as fast as the C/C++ engine.

One possible C/C++ engine I suggest is that of the Android OpenWnn(You can download the source code and try that IME on an Android phone, https://github.com/yxl/Android-OpenWnn), which has been optimized for phone. Also there may be other suitable engines.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hi Yuan,

Thanks for the info.
How did we develop the original jp-kanji keyboard, is that code human-compiled (translated) from some other library?
> Would you like to work on the kanji keyboard? I may fix up it for you.

Thanks. I want to use the fixed keyboard/IME.

My first plan is using Google IME CGI interface (http://www.google.co.jp/ime/cgiapi.html).
Yuan,

BTW, may I know what's the source of the Japanese dictionary we removed in Bug 808849?
We would like to move it back but want to make sure the license is ok.

Thanks.
(Please see Comment 7 as well)
Flags: needinfo?(xyuan)
The license file is included in the jskanji source files:

https://github.com/mozilla-b2g/gaia/blob/master/apps/keyboard/js/imes/jskanji/dict/COPYING

It is an Apache-like license.
Flags: needinfo?(xyuan)
I guess we have to ask for legal's help to confirm this.

Hi Harvey,

Could you please help us understand if we could put the dictionary into our b2g project?
This dictionary is from http://sourceforge.jp/projects/ipadic/, see Comment 10 for its license.

Thanks.
Flags: needinfo?(handerson)
I think I can make it work first so take this bug.
Assignee: nobody → lchang
Status: NEW → ASSIGNED
This patch only focuses on making "js-kanji" engine work first. However, the new composition APIs doesn't support changing the style of composition string so I left some old "sendPendingSymbols" statements as comments to remind us of the original design.

Rudy, could you please help review this patch? Thanks.
Attachment #832006 - Flags: review?(rlu)
Blocks: 935858
Comment on attachment 832006 [details]
Pull Request: https://github.com/mozilla-b2g/gaia/pull/13681

Guess this is good enough for contributors to follow up.
Luke, thanks.
Attachment #832006 - Flags: review?(rlu) → review+
travis passed:
https://travis-ci.org/mozilla-b2g/gaia/builds/13952994

merged in gaia master:
https://github.com/mozilla-b2g/gaia/commit/6e5be99492a3ef7b66f9fa477d1c395bec71982d

Rudy, Thanks!


Note:

Please follow the steps below to enable the js-kanji input method.

1. Refer to "apps/keyboard/js/imes/jskanji/README" to cook the "dict.json."
2. Use GAIA_KEYBOARD to enable "jp-kanji" when you reset gaia. 
   e.g. `GAIA_KEYBOARD_LAYOUTS=en,jp-kanji make reset-gaia`
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Should we do anything about this bug for 1.2? Right now, it's at least suffering from the Keybord js error, which makes it completely unusable.
(In reply to Axel Hecht [:Pike] from comment #17)
> Should we do anything about this bug for 1.2? Right now, it's at least
> suffering from the Keybord js error, which makes it completely unusable.

We probably don't need to do anything because jskanji was left just like that in v1.1 release.
Flags: needinfo?(handerson)
(In reply to Luke Chang [:lchang] from comment #16)
> travis passed:
> https://travis-ci.org/mozilla-b2g/gaia/builds/13952994
> 
> merged in gaia master:
> https://github.com/mozilla-b2g/gaia/commit/
> 6e5be99492a3ef7b66f9fa477d1c395bec71982d
> 
> Rudy, Thanks!
> 
> 
> Note:
> 
> Please follow the steps below to enable the js-kanji input method.
> 
> 1. Refer to "apps/keyboard/js/imes/jskanji/README" to cook the "dict.json."
> 2. Use GAIA_KEYBOARD to enable "jp-kanji" when you reset gaia. 
>    e.g. `GAIA_KEYBOARD_LAYOUTS=en,jp-kanji make reset-gaia`

When running make I get the following error:
$ make
python conv.py
dict.utf8
Traceback (most recent call last):
  File "conv.py", line 27, in <module>
    kana = kata2hira(arr[base+2][:-1])
IndexError: list index out of range
make: *** [json] Error 1


If I change this line to "print kata2hira(arr[base+2]) can still reproduce this error
I believe this error was caused by a bad dict.utf8.
Originally when I ran make I got the following error:

$ make
find ipadic -name "*.dic" -exec cat {} >> dict \;
iconv -f euc-jp -t utf-8 dict > dict.utf8
iconv: illegal input sequence at position 3
make: *** [dict.utf8] Error 1

(I thought I had resolved this error. But I believe that this crashed iconv left garbage in dict.utf8 which caused the previous error I reported.)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: