The GUI design is by intention very simple with a minimum of controls and windows. Most interactions take place within a single frame. My expectation is that users will startup the application and leave it loaded in the background using it from time to time as necessary. The user can cut and paste from other application into the input area and output can be copied out through the host system clipboard.
Kanjidic can be accessed either by radical+stroke count, Japanese readings or English key meanings. The radical+stroke entry can also be used to do kanji data entry.
I wrote JJDic as a pedagogic exercise to teach myself
Java. As such it was a great success. It covers a surprising range of the
features available in Java. I hope that it can also be a useful application.
You, the users, can help it to be a success as an application by letting
me know itfs shortcomings so that I can make it better.
I am also indebted to the providers of all of the free software that I used to develop this program. Sun Microsystems has created a marvelous development language in Java and has generously made it available to developers for free with very reasonable licensing. Nobody involved with this project will have to pay any royalties for Java or for the runtime system. This application is 100% pure Java but it does not carry any such logo because I donft want to pay for the verification of my test results.
I am also indebted to the GNU project and all of itfs contributors for emacs and the Java Development Environment (JDE). This was my first major development effort on Windoze and I suppose I should thank Bill Gates for not providing a decent program editor with that system. It forced me to learn emacs, something that I had not bothered to do in 20 years of UNIX experience.
So for now I reserve all commercial rights. I am distributing all source code but use is restricted to non-commercial applications. A notice to this effect is included in each source file.
In any case the source code is included and users are
encouraged to read it and hack on it if the spirit moves you. It is fairly
well commented with explanations of the algorithms as well as my observations
on Java and programming style.
I developed the application on Windoze 95 Japanese version and I know that all of the necessary components are there, I can only guess for other systems. I thought that Microsoft offered Japanese support for non Japanese operating systems but an hour of searching on their web site failed to turn it up. If you have access to the CD-ROM version of Office you can install Japanese language support from the file c\valuepack\Fareast\Jpnsupp.exe. This contains the Japanese fonts and, I believe, the IME front end processor.
For Apple users the Japanese Language Kit provides a very
nicely integrated way to run both Japanese and English applications on
the same system. I am not sure exactly how you should register the application
since Java is really an interpreter. The class jdic.JJDic.class should
certainly be a Japanese application but the JLKfs registration function
surely doesnft know anything about Java classes and you probably donft
want to make the whole Java run time system a Japanese application, although
you might. I would be very interested to hear by email from Apple users
and particularly JDK users. Unfortunately the JLK will set you back about
a hundred bucks but if you are serious about studying Japanese you will
probably have to spend it eventually.
Unix users are probably running X-windows. Japanese fonts
are available in the public domain for kterm and wnn. These should probably
work fine. If you can use kterm then JJDic should also work fine.
The initialization file .jjdic is a Java properties file, it can contain definitions of two properties:
Technical Note: Sorting the index. It appears that the index of edict is sufficiently orderly to push quicksort performance towards itfs O(N2) worst case. After trying several variants of quicksort I finally gave up and used Shellsort which is always O(n log2 n). The difference was immediately noticable.
% java ?mx30m jdic.JJDic
I donft know how this works on Macintosh where there is no command line but I hope somebody will write to tell me. The ?mx30m argument means that the Java virtual machine must be able to expand to 30 MB. Anything less and edict will not load.
Regular users will probably want to make an alias or batch
file. In under Windoze you can then make a shortcut to the batch file and
add it to your start menu. Icons I leave up to you.
The Open Dictionary option presents the user with a dialog for opening new glossary files. The dialog box can be seen in Figure 2. The text area at the top of the dialog box allows the user to enter a file or path name directly. The button labeled "Search" will bring up a file selection dialog. Either one can be used to enter the pathname of the dictionary to be opened. In the middle of the dialog is a set of radio buttons to select the input encoding of the dictionary file. The checkbox at the bottom should be checked if no index exists or if the index may be out of date. The only reason not to leave it checked is if the user does not want to wait for index generation. Finally the user should click either the "OK" button to open the dictionary or the "Cancel" button or the close button on the window frame to close the dialog without opening a dictionary. When a dictionary has been successfully opened itfs name will appear on the Dictionaries menu.
The second option is "Showdic" this checkbox menu item controls the listing of the dictionary name in the output area. In cases where multiple dictionaries are in use the user may want to see which dictionary was the source of a particular answer. If "Showdic" is checked then each entry in the display area will be prefixed with the name of the dictionary in which it was found. Showdic is set true by default.
The input can include kanji, kana or romaji. Katakana and hiragana are not distinguished for standard dictionary searches. Romaji is not case sensitive.
Cut and paste will work between the system clipboard and JJDic. This makes it easy to look unknown words when you are reading a Japanese document. Just cut or copy the unknown string from the document and paste it into the text entry field on JJDic. The Java runtime system should take care of the necessary translation from the system default encoding to Unicode in the input area. Similarly you can cut information from either the input text field or the output text area in JJDic and paste it into your other applications.
If you have a Japanese input method you can type Japanese directly into the JJDic input field.
N.B. Both the cut and paste of Japanese text and use of a Japanese input method depend on the correct translation from the local system encoding into Unicode. This capability is only present in Java 1.1. If you have an older Java 1.0 runtime system you must upgrade to 1.1 to use JJDic.
Kanjidic has a wealth of information on the individual kanji characters. I am rather conservative about how much of this information I actually present. Figure 3 shows an example of the information displayed from kanjidic. At the upper left is the character that we have looked up. beside it to the right are the on and kun yomikata (readings) for the character. Below are the JIS code and Unicode for the character the Bushu (radical) and the total number of strokes. If there are multiple stroke counts then the first is preferred [sic.] and the others are common miscounts. After that are the Nelson index number and Halpern index number from respectively The Modern Readerfs Japanese-English Character Dictionary, second revised edition by Andrew N. Nelson, Tuttle; and the New Japanese-English Character Dictionary, by Jack Halpern, Kenkyusha. Lastly you will see the English meanings for the character. Only the character, the JIS code and Unicode are always present. Some characters lack on yomi or kun yomi or are not listed in one or the other of Nelson or Halpern and some have no English meanings given.
My apologies if I have left out some field that you think indispensable. I left out the Skip codes because I was not sure of my position on commercialization and those codes have restrictive covenants. Most of the other codes seem occasionally interesting but not of sufficient general recurrent interest to justify their inclusion in this sort of display. On feature that I am considering for a future enhancement is allowing the user to specify exactly which kanjidic fields will be displayed.
The selection can include kanji, kana (hiragana or katakana) or romaji. Kanji are looked up directly and there can be as many as the user likes. Unlike the standard dictionary search katakana and hiragana are distinguished in kanjidic searches. Katakana strings are considered to be Kun yomikata and hiragana strings are considered to be On yomikata. The user is presented with a dialog showing all of the kanji that match the query. The dialog has four buttons across the top of the window for On-Yomi Kun-Yomi Kanji and English pressing one of these buttons will display the kanji that match in that category. The user can then select and click on a kanji to display detailed information about a particular character.
The user begins by pressing the
button. The kanji input dialog, Figure 4, will be displayed. This dialog
is persistent and can be kept open and used multiple times. It will persist
until explicitly dismissed by the user. The Go button is used to select
the stroke count value shown in the selection window. If the selection
is changed the dialog will automatically proceed. Selecting 1 in this case
can be done by pressing go or by selecting another value first and then
reselecting 1.
When the number of strokes in the radical part of the
character is selected another dialog will be displayed showing all of the
radicals with that number of strokes. Figure 5 shows the dialog for 1 stroke
radicals. It also illustrates a point. In JIS and less so in Unicode there
are radical forms that have no representation in the character set. Furthermore
there are many Unicode characters that have no mapping to a JIS character.
In these cases I have chosen a kanji that uses the radical part and as
few additional strokes as possible to indicate the radical. I then darken
the non-radical part of the character to highlight the radical part. Itfs
a crude kludge but it gets the job done.
After the user chooses which radical to use the original Kanji Input Dialog will be updated to ask how many additional strokes are in the final character. The user should count how many strokes in addition to the strokes that form the radical part there are in the final character and choose that number from the choice object in the dialog box. JJDic will then prepare a dialog containing all of the kanji with the specified radical and total strokes equal to the radical part plus the specified number of additional strokes. Figure 6 shows all of the steps involved in kanji input. The next step is to select a kanji from the final dialog box. The user can then either lookup the character in kanjidic by pressing the lookup button, or he can enter the character into the input area by pushing the insert button. After entering a character in the input area she can search for it in the main dictionary.
I have developed and tested the system using Windoze 95 Japanese version. I am particularly interested in users of other systems. Solaris, Mac other Unices etc.