Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine if a character is a Chinese character

How to determine if a character is a Chinese character using ruby?

like image 891
HelloWorld Avatar asked Apr 28 '10 08:04

HelloWorld


People also ask

How do you identify Chinese characters?

Optical character recognition (OCR) – Many apps and websites provide OCR features where you can scan or take pictures of the character(s) you want to look up. Google Docs has such a feature and there are others online you can easily find by searching for “Chinese” and “OCR”.

What makes up a Chinese character?

It is made of strokes. There are 6 basic strokes. Some of them have several variants, and strokes can be combined to create more strokes. But the basic idea is that most characters are made from a small number of strokes.

How are Chinese characters derived?

They were created by combining two components: a phonetic component on the rebus principle, that is, a character with approximately the correct pronunciation. a semantic component, also called a determinative, one of a limited number of characters which supplied an element of meaning.

What type of characters are Chinese?

Chinese characters are logograms. This means that, instead of being written using the letters of an alphabet, logograms consist of characters or “pictures” that represent a word. Egyptian hieroglyphics are a good example of this.


1 Answers

Ruby 1.9

#encoding: utf-8   
 "漢" =~ /\p{Han}/
like image 147
steenslag Avatar answered Sep 29 '22 22:09

steenslag