com.kawao.kakasi
Class KanwaDictionary

java.lang.Object
  |
  +--com.kawao.kakasi.KanwaDictionary

public class KanwaDictionary
extends java.lang.Object

This class represents the Kanwa dictionary.

Version:
$Revision: 1.6 $ $Date: 2003/01/01 08:54:30 $
Author:
Kawao, Tomoyuki (kawao@kawao.com)
See Also:
Kakasi.getKanwaDictionary()

Constructor Summary
KanwaDictionary()
           
 
Method Summary
 void addItem(java.lang.String kanji, java.lang.String yomi, char okurigana)
          Adds dictionary entry.
 void close()
          Closes the dictionary file.
 void finalize()
          Called when there are no more references to this object.
 void load(java.io.Reader reader)
          Reads and adds dictionary entries from the reader.
 void load(java.lang.String filename)
          Reads and adds dictionary entries from the file.
 void load(java.lang.String filename, java.lang.String encoding)
          Reads and adds dictionary entries from the file with the specified encoding.
static void main(java.lang.String[] args)
          Main program of 'mkkanwa_j'.
 void save(java.io.RandomAccessFile file)
          Saves this Kanwa dictionary to the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KanwaDictionary

public KanwaDictionary()
Method Detail

load

public void load(java.lang.String filename)
          throws java.io.IOException
Reads and adds dictionary entries from the file. The file encoding is "JISAutoDetect".
Parameters:
filename - the file name.
Throws:
java.io.IOException - if an error occurred when opening or reading the file.

load

public void load(java.lang.String filename,
                 java.lang.String encoding)
          throws java.io.IOException
Reads and adds dictionary entries from the file with the specified encoding.
Parameters:
filename - the file name.
encoding - the file encoding.
Throws:
java.io.IOException - if an error occurred when opening or reading the file.

load

public void load(java.io.Reader reader)
          throws java.io.IOException
Reads and adds dictionary entries from the reader.
Parameters:
reader - the reader object.
Throws:
java.io.IOException - if an error occurred when reading from the reader.

addItem

public void addItem(java.lang.String kanji,
                    java.lang.String yomi,
                    char okurigana)
Adds dictionary entry.
Parameters:
kanji - the kanji string.
yomi - the yomi string.
okurigana - the okurigana character.

close

public void close()
           throws java.io.IOException
Closes the dictionary file.
Throws:
java.io.IOException - if an error occurred when closing kanwa dictionary file.

finalize

public void finalize()
              throws java.lang.Throwable
Called when there are no more references to this object.
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable - the Exception raised by this method

save

public void save(java.io.RandomAccessFile file)
          throws java.io.IOException
Saves this Kanwa dictionary to the specified file.
Parameters:
file - the destination file.
Throws:
java.io.IOException - if an error occurred when writing to the file.

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Main program of 'mkkanwa_j'.
Parameters:
args - command line arguments.


Copyright (c) 2002-2003 Tomoyuki Kawao. All Rights Reserved.