Tae Kim's Guide to Japanese Forum

THIS FORUM IS NOW CLOSED TO NEW REGISTRATIONS BUT LEFT FOR PROSPERITY!

You are not logged in.

#1 2007-07-18 01:23:59

Koryo
Member

Replacing rikaichan's EDict

Update (2010-06-28): As of Rikaichan v2.00, you can use the 'd' key to hide the glosses!  Thanks to arbl for pointing this out!

- rikaichan-words.jar with English glosses removed (EDict dated 2007-07-17)
- rikaichan-words.jar with English glosses (EDict dated 2007-07-17)
- dicttool.jar for creating the above or updating your own dictionaries yourself

Instructions:
1. Replace your existing rikaichan-words.jar file from under your Firefox settings directory with the one you download from here.  If you're not sure where this is, just search the files on your computer for one called rikaichan-words.jar.  On mine its full path was ~/.mozilla/firefox/a53yayd2.Default User/extensions/{6D898772-AD34-4c16-86BB-9DE787A5DEA0}/chrome/rikaichan-words.jar; on yours it will probably be somewhere else.
2. Restart Firefox.
3. Enjoy furigana without glosses, or an updated dictionary! ^_^

Do-it-yourself instructions:
1. Download your favourite EDict format dictionary.
2. Convert it to UTF-8 encoding and UNIX LFs (i.e., not DOS CRLFs).  [iconv is available for win32 as well; thanks, pazu!]

UN*X e.g., wrote:

$ iconv -f EUC-JP -t UTF-8 < edict > edict.utf-8

3. Run dicttool on the file to generate the index file and optionally strip the glosses.

$ java -jar dicttool-0.1.jar edict.utf-8 dict.dat dict.idx [strips glosses]
$ java -jar dicttool-0.1.jar edict.utf-8 dict.idx [leaves glosses]

4. Replace the dict.* files from your existing rikaichan-words.jar archive.

$ jar xvf rikaichan-words.jar
$ cp <path to new ones>/dict.dat <path to new ones>/dict.idx content/
$ jar cvf rikaichan-words.jar content

5. Restart Firefox.
6. Enjoy updated furigana without glosses! ^_^
* I don't use Windows; I don't know how to do this in Windows, but it should be simple enough. tongue

NB It works on my Firefox installation, but I'm not sure in general.  Please let me know if it doesn't work on yours.

Last edited by Koryo (2010-11-13 01:51:45)


「正しい判断は経験から生まれ、経験は間違った判断から生まれる。」

Offline

#2 2007-07-18 01:35:00

Faumdano
Moderator

Re: Replacing rikaichan's EDict

I'll have to set up cygwin again on my windows box and give it a shot -- thanks a ton for the info. The sluggish updates to the dictionary files rikaichan uses have been a slight annoyance for some time.


蒔かぬ種は生えぬ

Offline

#3 2007-07-18 01:40:59

Koryo
Member

Re: Replacing rikaichan's EDict

[edit: iconv is available for win32 as well; thanks, pazu!]

You should be able to use the Windows version of a JVM and cmd.exe to do the same thing, so there shouldn't be a need for cygwin (not that I'm suggesting that using cmd.exe is a pleasurable experience cool).  I'm sure there are tools to convert file encodings too for Windows.  If nothing else, Eclipse will do it.

[edit: oh, I forgot, In Windows, it may be necessary to convert the dictionary file to use UNIX-style LFs instead of DOS-style CRLFs; I'm not sure]

Last edited by Koryo (2007-07-18 08:56:15)


「正しい判断は経験から生まれ、経験は間違った判断から生まれる。」

Offline

#4 2007-07-18 08:11:14

richvh
Member

Re: Replacing rikaichan's EDict

One option in Windows to do the encoding conversion is load into JWPce and save in the desired encoding.


Richard VanHouten
[url=http://www.citlink.net/~richvh]ゆきの物語[/url]

Offline

#5 2007-07-18 08:49:22

pazu
Member

Re: Replacing rikaichan's EDict

iconv is available for native win32 here, without the need to install cygwin.


--
手加減せずに私の日本語を直してください

Offline

#6 2007-07-18 09:34:21

scout
Member

Re: Replacing rikaichan's EDict

Great work, Koryo!

I think you've done most of the work for what I wanted to do: adding pitch accent markings to rikaichan.  My current idea is to make up a separate file with words + pitch accent listings which could then be merged into the edict file before running dicttool.  I'll probably write some perl to do the merge with edict.  My guess is most of the information will be hand copied from 大辞林, unless someone else is aware of a pre-existing file with that information.

Offline

#7 2008-03-07 19:48:35

ren1999
Member

Re: Replacing rikaichan's EDict

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\James>cd ..

C:\Documents and Settings>cd ..

C:\>cd "Program Files"

C:\Program Files>cd GnuWin32

C:\Program Files\GnuWin32>cd bin

C:\Program Files\GnuWin32\bin>iconv -f EUC-JP -t UTF-8 < edict > edict.utf-8

C:\Program Files\GnuWin32\bin>dir
Volume in drive C has no label.
Volume Serial Number is 5CF4-0607

Directory of C:\Program Files\GnuWin32\bin

03/08/2008  08:39 AM    <DIR>          .
03/08/2008  08:39 AM    <DIR>          ..
03/08/2008  01:27 AM         8,382,360 edict
03/08/2008  08:39 AM         9,525,915 edict.utf-8
10/14/2004  07:08 AM            16,896 iconv.exe
10/14/2004  07:08 AM            11,776 libcharset1.dll
10/14/2004  07:08 AM           978,432 libiconv2.dll
10/10/2004  01:25 AM           101,888 libintl3.dll
               6 File(s)     19,017,267 bytes
               2 Dir(s)  28,120,928,256 bytes free

C:\Program Files\GnuWin32\bin>java -jar dicttool-0.1.jar edict.utf-8 dict.idx
'java' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\GnuWin32\bin>

I was able to get everything to work up until here. Java RunTime 6 gives a string of errors when trying to use dicttool.

Offline

#8 2008-03-07 20:10:37

Faumdano
Moderator

Re: Replacing rikaichan's EDict

based on the error in your post, 'java' isn't in your path. Either add it to your path or run it explicitly from the folder it resides in: ie C:\Program Files\GnuWin32\bin> c:\java\java.exe ...

[edit] you said java spit out a bunch of errors, can you post them?

Last edited by Faumdano (2008-03-07 20:12:12)


蒔かぬ種は生えぬ

Offline

#9 2008-03-07 22:50:37

賢狼ほろ
Member

Re: Replacing rikaichan's EDict

Is there a monolingual edict file available?

Offline

#10 2008-03-07 23:24:23

richvh
Member

Re: Replacing rikaichan's EDict

Monolingual?  You mean Japanese-Japanese?  No, because that isn't part of the Edict project, which is essentially Japanese-English.


Richard VanHouten
[url=http://www.citlink.net/~richvh]ゆきの物語[/url]

Offline

#11 2008-03-13 23:44:18

ren1999
Member

Re: Replacing rikaichan's EDict

Faumdano wrote:

based on the error in your post, 'java' isn't in your path. Either add it to your path or run it explicitly from the folder it resides in: ie C:\Program Files\GnuWin32\bin> c:\java\java.exe ...

[edit] you said java spit out a bunch of errors, can you post them?

I downloaded GnuWin32 from this link.
http://sourceforge.net/project/download … rror=jaist

I downloaded the latest zipped Edict dictionary file from here.
http://www.csse.monash.edu.au/~jwb/j_edict.html

I downloaded the dicttool.jar file from here by right clicking on the link and saving it.
http://www.guidetojapanese.org/forum/vi … hp?id=2026

I got the WindowsXP based The Java SE Development Kit (JDK) from here.
https://sdlc4d.sun.com/ECom/EComActionS … 58F9419452

I unzipped the edict file from edict.zip directly into..
I moved dicttool-0.1.jar directly into..
C:\Program Files\GnuWin32\bin

I executed C:\WINDOWS\system32\cmd.exe
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\James>cd ..

C:\Documents and Settings>cd ..

C:\>cd ..

C:\>cd "Program Files"

C:\Program Files>cd GnuWin32

C:\Program Files\GnuWin32>cd bin

C:\Program Files\GnuWin32\bin>iconv -f EUC-JP -t UTF-8 < edict > edict.utf-8

C:\Program Files\GnuWin32\bin>

C:\Program Files\GnuWin32\bin>java -jar dicttool-0.1.jar edict.utf-8 dict.idx
??: ??????: ╫  ??????????
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOfRange(Unknown Source)
        at java.lang.String.<init>(Unknown Source)
        at java.io.BufferedReader.readLine(Unknown Source)
        at java.io.BufferedReader.readLine(Unknown Source)
        at org.yashoku.util.rikaichan.dicttool.io.PositionBufferedReader.readLin
e(PositionBufferedReader.java:67)
        at org.yashoku.util.rikaichan.dicttool.DictTool.run(DictTool.java:95)
        at org.yashoku.util.rikaichan.dicttool.DictTool.main(DictTool.java:51)

C:\Program Files\GnuWin32\bin>

Offline

#12 2008-03-14 00:24:34

Faumdano
Moderator

Re: Replacing rikaichan's EDict

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

So increase the heap space the Java VM is allowed to use and try again.


蒔かぬ種は生えぬ

Offline

#13 2008-12-06 23:34:38

Scott
Member

Re: Replacing rikaichan's EDict

Hello there

I'm trying to add my own modified version of edict to rikaichan.

I increased the heap space as Faumdano said using this:
C:\Program Files\GnuWin32\bin>java -Xmx1128m -jar dicttool-0.1.jar edict.utf-8 dict.idx

It went OK, then I followed the remaining steps, and when I try to load rikaichan on Firefox I get this error:

Error loading dictionary: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIScriptableUnicodeConverter.ConvertToUnicode]"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: chrome://rikaichan/content/data.js :: anonymous :: line 100"  data: no]

Does anybody know how to solve this?

Offline

#14 2010-01-26 04:24:11

ViolaGirl
Member

Re: Replacing rikaichan's EDict

This hasn't been updated in a long time, so perhaps I will not get a reply... I just tried getting the newest edict and issuing your commands (I use Linux). iconv worked just fine. However, when it came to removing the glosses, I got an error message in Japanese saying it didn't know the character x and it would leave it as is, and the glosses were not removed.

megini@squeesama:~/Desktop/edict$ java -jar dicttool-0.1.jar edict.utf-8 dict.dat dict.idx
注意: 知らない文字: ×  そのままにしています

Any ideas? For now I guess I'll use one of the premade ones from '08, but it would be nice to be able to make my own!

Last edited by ViolaGirl (2010-01-26 04:24:47)


Currently studying abroad in Korea and having a blast!

Offline

#15 2010-07-06 13:37:14

arbl
Guest

Re: Replacing rikaichan's EDict

1. Enable rikaichan
2. Mouse over nihongo text
3. Press 'd'
4. Enjoy

#16 2010-07-07 12:06:55

sanbou253
Member

Re: Replacing rikaichan's EDict

Thanks Arbl! I just got the most recent rikaichan and thought I'd have to install Koryo's english glosses-less jar file again.

Offline

Board footer

Powered by FluxBB 1.5.3