On Thu, 30 Oct 2003 09:03:05 -0000
"Martin Bryan" <martin@is-thought.co.uk> wrote:
> The UK would like to introduce Jeni Tennison's paper entitled Datatype
> Library Language (http://www.jenitennison.com/datatypes/) for discussion as
> input for Part 5.
The Japanese national member body very strongly doubt that this can capture the
Japanese calendar. (My implementation in Java is available at
http://www.asahi-net.or.jp/~eb2m-mrt/hidden/wareki.jar).
Gengou (which I have already explained in this ML) makes it hart to implement
the Japanese datatype. For example, the following errors have to be detected.
Taisho 20 is incorrect, since Taisho 15 is the last year of Taisho.
Meiji 45 August is incorrect, since Meiji 45 ended in July
Taisho 15 December 25 is incorrect, since Taisho 15 ended on December 24
Taisho 1 January is incorrect, since Taisho 1 started in July.
Shouwa 1 January 2 is incorrect, since Shouwa 1 started on January 8.
As usual, 31 an February has to carefully checked.
On top of this difficulty, the Japanese calendar uses kanji characters for
representing numbers. Here is a summary.
1. Synonyms
Two characters for representing 1, say ONE1 and ONE2
Two characters for representing 2
Two characters for representing 3
Two characters for representing 5
Two characters for representing 10, say TEN1 and TEN2
2. Different representations of 10x + y
10x + y (where x, y!= 0) has three representations:
x y
x TEN1 Y
x TEN2 Y
3. Zero
Since we have ZERO, 10x (x!=1) has two representations
x ZERO
x TEN1
10 has three representations:
TEN1
TEN2
ONE1 ZERO
4. A fragment of my JavaCC program for the kanji numbering system.
int \u4e8c\u304b\u3089\u4e5d\u3067\u59cb\u307e\u308b\u6f22\u6570\u5b57():
{
int \u4e8c\u6841\u76ee;
}
{
(("\u4e8c"| "\u5f10") {\u4e8c\u6841\u76ee = 2;}|
("\u4e09"| "\u53c2") {\u4e8c\u6841\u76ee = 3;}|
"\u56db" {\u4e8c\u6841\u76ee = 4;}|
("\u4e94"| "\u4f0d") {\u4e8c\u6841\u76ee = 5;}|
"\u516d" {\u4e8c\u6841\u76ee = 6;}|
"\u4e03" {\u4e8c\u6841\u76ee = 7;}|
"\u516b" {\u4e8c\u6841\u76ee = 8;}|
"\u4e5d" {\u4e8c\u6841\u76ee = 9;})
[
([("\u5341"|"\u62fe")]
(("\u4e00"| "\u58f1") {return \u4e8c\u6841\u76ee*10+1;}|
("\u4e8c"| "\u5f10") {return \u4e8c\u6841\u76ee*10+2;}|
("\u4e09"| "\u53c2") {return \u4e8c\u6841\u76ee*10+3;}|
"\u56db" {return \u4e8c\u6841\u76ee*10+4;}|
("\u4e94"| "\u4f0d") {return \u4e8c\u6841\u76ee*10+5;}|
"\u516d" {return \u4e8c\u6841\u76ee*10+6;}|
"\u4e03" {return \u4e8c\u6841\u76ee*10+7;}|
"\u516b" {return \u4e8c\u6841\u76ee*10+8;}|
"\u4e5d" {return \u4e8c\u6841\u76ee*10+9;}))
|
("\u5341"|"\u62fe") {return \u4e8c\u6841\u76ee*10;}
|
"\u3007" {return \u4e8c\u6841\u76ee*10;}]
{return \u4e8c\u6841\u76ee;}
}
-- MURATA Makoto <murata@hokkaido.email.ne.jp> -- DSDL members discussion list To unsubscribe, please send a message with the command "unsubscribe" to dsdl-discuss-request@dsdl.org (mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)Received on Fri Oct 31 04:17:49 2003
This archive was generated by hypermail 2.1.8 : Fri Dec 03 2004 - 14:00:27 UTC