# gWaei Manual

gWaei is a program for made for searching dictionary files created by Jim Breen's WWWJDIC Project.

If you need help outside of what is covered in this manual, there is the gWaei homepage with the latest news and updates, and the gWaei IRC channel where you can ask questions.

## Features

gWaei has a number of features. Many of them are enabled through installing specific things. You can find out what is available and how to get it working by looking at the "Features" tab in the setting dialog. The major ones are listed below.

### Searching Features

gWaei will do it's best to return the most relevant results. The best ones are organized to the top. A bit farther down, example phrases are shown if available. As you keep going, much like searching in Google, the results will become more and more irrelevant.

Most searches in gWaei support regular expressions. You don't need to be an expert in them to find ways to put them to good use. A way for beginners to get started is to use the insert menu where descriptive names have been used to the characters to to give clues what they do. For a small tutorial on regular expressions, please refer to the Advanced Searching section of this manual.

### Kanjipad

Kanjipad is a very simple program for Kanji handwriting recognition. In gWaei's version of it, the user draws a character onto the canvas of the window. With each stroke added, Kanjipad makes new guess at what Kanji character you likely want. By clicking the kanji that appear to the right of the canvas, they will be copied to the search input for you.

### Kanji and Radicals Dictionary Features

Each dictionary on it's own enables features in gWaei. The Kanji dictionary allows you click Kanji in the results pane to quickly look up in the Kanji sidebar. The Radicals dictionary enables the "Radical Search Tool" menu item. When both dictionaries are installed, the "Radical Search Tool" also has a stroke count spinner button.

The Kanji and Radicals dictionaries each provide different information that the other doesn't about individual Kanji characters. Because of this, when they are both installed a file called Mix in the ~/.waei folder will be created, combining the features of both into one. When doing searches from that point on, the Kanji dictionary selection will now use the Mix dictionary file and the Radicals dictionary selection will be hidden.

### Update Dictionary Feature

When Rsync is installed, it is possible for gWaei to update the installed dictionaries through the EDICT Rsync servers with the click of the Update button. This is preferable to doing a straight reinstall, saving the EDICT server's bandwidth, thus saving the maintainers money.

Note: If the Update button in the Preferences dialog is still disabled even though Rsync is installed, it is likely gWaei was compiled on a machine where Rsync was not available at build time. In those cases, the dictionary update mechanism is perminently disabled.

## Installing Dictionaries

Before doing any searches, some dictionaries need to be installed. gWaei will automatically pop up the Preferences dialog to help you get started if it doesn't find any dictionaries in the ~/.waei directory. If you don't install any dictionaries then, closing the dialog will quit the entire applicaton.

### Supported Dictionary Installs

In the Install Dictionaries tab, if you click one of the "Add" buttons, gWaei should install that dictionary from Jim Breen's WWWJDIC ftp site automatically, taking care of unzipping, converting the encoding, and post-processing the file. If you want to install a dictionary file manually, you will have to do these steps yourself.

If you are in a bind without an internet connection, it is still possible to install dictionaries through offline means. If you click the triangles for the dictionaries in the Preferences dialog, you can change the install source. Through this method, pre-downloaded local files on the hard drive are selectable.

### Unsupported Dictionary Installs

If you want to install a non-supported dictionary like the German-Japanese dictionary made by the Wadoku Project, you will have to follow a procedure similar to below.

1. % wget ftp://ftp.monash.edu.au/pub/nihongo/edict.gz

2. % gunzip edict.gz

3. % iconv -f EUC-JP -t UTF-8 -o English edict

4. % mv English ~/.waei

The order that you install the unsupported dictionaries determines the order they appear in the list.

If you have a Kanji or Radicals dictionary of your own, you will probably want to name it as such with some kind of unique identifier. This will make gwaei use it's kanji search algolithms instead of it's general ones. For example, you could call it, "Kanji FR", "Kanji2".

Note: If you manually install dictionaries, gWaei can't do any post-processing on them in the normal fashion. There are ways to hack gWaei into creating a Mix dictionary, but this is not officially supported. When installing custom dictionaries, you will probably want to avoid the default names of the dictionaries, including English, Kanji, Radicals, Mix, Places and Names.

Please contact one of the developers if you want more support for other dictionaries!

## Advanced Searching

gWaei already tries to do semi-intelligent searches, placing the most relevant results at the top. It is possible to filter out even more unwanted results by understanding how gWaei does the searches. There are basically two separate search engines the program employs depending on the dictionary file that is being used. General searches and Kanji/Radical searches.

### General Searches

General searches allow the usage of regular expressions. Even if you do not type in a regular expression yourself, gWaei still is using them in the background to categorize and move relevant results to the top of the window. Below are some examples of meta-characters and phrases.

- \b is used to denote word boundaries.

- \B is used to denote non word bondaries.

- . is a wild card character. It represents one character.

- .* add a star and it means any number of the character.

- .+ means at least one of the character.

- (A|B) would return results containing "A" or "B".

Example: If you search for "fish\b", results like "fish" and "monkfish" would pop up. "Fishing", "fisherman", and "unselfishness" would not.

### Kanji and Radical Searches

These dictionaries do not accept regular expressions. Instead, gWaei divides the query into atoms and makes sure that every one of the atoms exists in the results returned. The main kind of atom you will be using with these dictionary are kanji and radical characters. The other type of atom is in the form of a capital letter and a number. Below are some example of this type.

- G# will make sure that only kanji of # grade level are returned.

- S# will make sure only kanji of # strokes are returned.

- J# returns the kanji that will appear on that level of the JLPT.

- F# will return kanji with a specific appearance frequency in texts.

Example: 口田S14 would return results that have Kanji/radicals 口 and 田 and take 14 strokes do draw. It doesn't matter if you put spaces to increase readability as gWaei will filter them out. 口田 S14 will return the exact same results.

## Searching from the Console

gWaei, when installed, also includes a symbolic link to itself named Waei. By typing waei into a terminal, most of the functionality of gWaei is accessable without a GUI.

- waei fish will search for fish in the English dictionary.

- waei -d Kanji 語 will search for 語 in the Kanji dictionary.

- waei --help will show available commands.

## Tips

There are a few other things to notice about gWaei that will make your exprience with it more enjoyable. You will likely get them with time, but he sooner you do notice them, the more gWaei will grow on you.

gWaei automatically moves focus where it makes sense. If you start typing, the focus will move to the search input box. If you press an arrow key, the focus will move to the results box. Alt-Up and Alt-Down will cycle the installed dictionaries and the focus will move to the search input box so you can start typing. You don't need to go clicking around the interface to do things (but you can if you want.)

If you install the Kanji dictionary, it is highly recommended you also install the radical dictionary. Unless they are both installed, many of the most interesting features of the gWaei won't be enabled. Don't miss out on the fun!

The save button has the unusual label Append. Why might you ask? It is so you can easily compile a list of vocabulary words in a file. Every time you click the button, the results in the window will be added to the end of the set save file. If you have a flash card program on your computer, you can then load those words into it using the file. You can also open the file in a word processor and add advanced formatting.

For more control, you can print or save specific sections of text by highlighting it before selecting the button or menu.