edu.stanford.nlp.trees.international.pennchinese
Class RadicalMap

java.lang.Object
  extended by edu.stanford.nlp.trees.international.pennchinese.RadicalMap

public class RadicalMap
extends Object

A way to determine the primary (or "semantic") radical of a Chinese character or get the set of characters with a given semantic radical. The information was extracted from the Unihan database with a script and then converted into the string format below.

Author:
Galen Andrew

Constructor Summary
RadicalMap()
           
 
Method Summary
static Set getChars(char ch)
          What are the Characters with this primary radical?
static char getRadical(char ch)
          What is the primary radical of this char?
static void main(String[] args)
          The main function reads a list of characters and outputs the list with corresponding radicals.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RadicalMap

public RadicalMap()
Method Detail

getRadical

public static char getRadical(char ch)
What is the primary radical of this char?

Parameters:
ch - a Chinese character
Returns:
the primary radical (also a char) or '.' if char has no radical

getChars

public static Set getChars(char ch)
What are the Characters with this primary radical?

Parameters:
ch - a Chinese character, interpreted as a radical
Returns:
the Set of chars with this as primary radical

main

public static void main(String[] args)
                 throws IOException
The main function reads a list of characters and outputs the list with corresponding radicals. If the input character is not Chinese or has no radical (like punctuation) the symbol '.' is output. The flag -infile specifies a file to read characters from. The -encoding flag can be used to specify the input encoding. Any other arguments on the command line will be interpreted as characters to translate.

Parameters:
args -
Throws:
IOException


Stanford NLP Group