JJReader

one of Jack's Hacks

version 1.0b6 by Jack Palevich

Copyright (C)1996 Palevich-Chen Industries. All Rights Reserved.

JJReader lets you read and understand Japanese language text, including web pages, e-mail, and other text files. It has the following features:

  • It handles text encoded in the JIS, EUC and/or SJIS standards.
  • It displays Japanese characters on any computer, without requiring any native OS support.
  • You can look up Japanese words and see their English equivalents.

Screen Shot of JJReader in Action

 

Requirements for JJReader

A Java Virtual Machine

JJReader is a Java application. That means it runs on your computer, as an application, rather than in your web browser as an applet. It is an application because it has to access several data files on your local hard disk. (It has to read the EDICT dictionary to look up words.)

In order to use JJReader you must have a Java VM installed on your computer. There are several sources of Java runtimes. Some you might look into include:

Unfortunately, Netscape Navigator won't let applets access the local file system (yet), so you can't use the excellent Java VM that comes with Netscape Navigator 3.0.

The Netscape Internet Foundation Classes

JJReader is built on top of the Netscape Internet Foundation Classes. You must download and install these classes in order to use JJReader.

A Japanese Font / Java Virtual Machine Japanese Language Support

You don't need a Japanese language font, and you don't need a Java Virtual Machine that supports the Japanese character set. JJReader comes with its own built-in portable Japanese font. However, if you do have a Japanese font, and a Java Virtual Machine that supports Japanese, then JJReader will probably display characters more quickly using your computer's font than using JJReader's built in font.

How to install JJReader

JJReader comes in a zip archive:
    JJReader.zip - (300K) all the files, except the EDict dictionary, in zip format.
ZIP decompressers are available for all systems. One source of free ZIP decompressers is Info-ZIP. Or, if you have a Macintosh, try ZipIt from Compression directory of the Info-Mac archives. You must use a ZIP decompresser that supports directories and long file names.

In addition, if you want to use the Japanese-English dictionary feature, you'll need a copy of EDICT, Jim Breen's Japanese-English dictionary. Several different versions are available from ftp.cc.monash.edu.au/pub/nihongo/.

You must download both an edict file and its matching .jdx file. Here is a matched pair.

  1. edict.zip (918Kb).
  2. edictjdx.zip (842 Kb).
To install JJReader:
  1. Download JJReader.zip.
  2. Unzip the file to a directory on your hard disk.
  3. Download the edict.zip and edictjdx.zip files to your hard disk.
  4. Manually place the edict and edict.jdx files in the directory COM\palevich\japanese\dictionary.
  5. On unix, which is a case-sensative file system, make sure that the two dictionary files are all in lower case ("edict", rather than "EDICT").

  6. Add the JJReader directory's Classes directory to your CLASSPATH. e.g. on Windows 95, if you placed the JJReader directory in the C:\ directory, you would add this line to your AUTOEXEC.BAT (Or you can add it to to the file JJReader.BAT)
  7. set CLASSPATH %CLASSPATH%;C:\JJReader\Classes

How to run JJReader

This depends upon your computer and your Java VM. If you have a command line environment, you can do something like this:
    java JJReader
Note: You will have to edit the files JJReaderFrame.java and JJReaderIFC.java to change the expiration date. I am no longer updating the JJReader program.

The JJReader User Interface

Use the File:About menu item to view this help file.

Use the File:Open menu item to open a file to read. The file can be encloded in either ASCII, EUC, or SJIS. JJReader will automaticly detect the format.

Use the File:Quit menu item to quit JJReader.

Use the File:Translate menu item to look up a selected text string in the Japanese-English dictionary. Select the string in the text window. The output will show up in the Results window.

About Output Methods

Different OS's have different ways of supporting the Japanese character set. JJReader supports two different ways of displaying Japanese text:
  1. Portable Unicode - works in all Java environments.
  2. Native Unicode - works in internationalized Java environements that have a Unicode Japanese font installed.
Use the pop-down list gadget to choose the output method you prefer.

By default, the "Portable Unicode" output method is enabled. This should work in any Java environment. However, due to deficiencies in awt, it is slower than native font support. (The problem is that awt doesn't support 1-bit-per-pixel Images.)

You can also look at Jim Breen's Japanese Page for more information about Japanese text processing.

(Unfortunately, Netscape IFC Barium release does not display Japanese text correctly with the Native output methods. Hopefully future releases of IFC and/or Java VMs will work correctly.)

Don't worry, you should still be able to use the Lookup menu item, even if the selected text looks slightly garbled.

Sample Japanese Characters

The following short japanese text phrases are encoded in SJIS (Shift-JIS). If you're viewing this in JJReader, and you are using the Portable Unicode Output method, which is the default, then you should see the Japanese (Kanji) characters. Similarly, if you've got a Japanese-enabled HTML browser, you should also see the Japanese (Kanji) characters. If, on the other hand, you are using an ASCII HTML browser, then you will see a few random garbage characters.

You can use these characters to test the Lookup function of JJReader.

猫 - Neko (cat).

日本語 - Nihongo (Japanese Language)

母 - Haha - (mother)

Sources of Japanese Text

Here are some sources of Japanese text, so you can try out JJReader

NTT Home Page

Yahoo! JAPAN

Useful Classes in JJReader

There are several useful classes included with JJReader. Look in the Classes folder:

COM.palevich.japanese.CodeUtil contains static methods for converting Japanese text between various encoding standards including SJIS, JIS, EUC, Unicode, and kuten. Based on Ken Lunde's book Understanding Japanese Information Processing.

COM.palevich.japanese.dictionary.* classes that accesses Jim Breen's free-ware EDICT Japanese-English dictionary.

COM.palevich.japanese.display.* classes that display Japanese text on normal, not-fully-Unicode-capable computers, even if there is no OS-level or Java-VM-level support for Japanese fonts.

Credits

This program was written by Jack Palevich over a period of several weeks. It was inspired by Jim Breen's excelent JReader program. It contains data files from JReader. The CodeUtil class uses algorithms from Ken Lunde's book: Understanding Japanese Information Processing.

Licence Agreement

Anyone can use this program and its contained Java classes for free.

This version will stop working after September 1, 1997.

Links to Related Sites

JavaDict is a similar program by Todd David Rudick, a computer science student at the University of Arizona.

Release Notes

1.0b6 - Now uses IFC 1.0.

1.0b5 - I don't remember what I changed.

1.0b4 - Switched from AWT to IFC. This fixed numerous scrolling, resizing, and redisplay bugs. (Still a few redisplay bugs left under Windows 95.)
Changed licence agreement. These classes are now in the public domain. Please let me know if you do anything interesting with them.

1.0b3 - Improved HTML instructions.
Changed download file organization.
Added unix-compatable .tar format.
Used RandomAccessStream to improve I/O performance.
Lookup now processes phrases instead of just single words.
Fixed case sensativity problems with resource file names.

1.0b2 - Fixed bugs.
Reduced RAM footprint by keeping dictionary on disk instead of in RAM. (saved 2.8Mb)
Reduced RAM footprint by using 8-bit Images instead of 32-bit images for storing
portable unicode font. (saved 150K)
Put classes into packages.
 

1.0b1 - first version.