Newsgroups: comp.sources.hp48 Path: seq!spell From: Marc Moline Subject: v07i017: japanese.mm - Japanese v1.0, Part01/01 Message-ID: <1992Sep28.213901.7772@seq.uncwil.edu> Followup-To: comp.sys.hp48 Sender: spell@seq.uncwil.edu (Chris Spell) Organization: Univ. of North Carolina @ Wilmington Date: Mon, 28 Sep 1992 21:39:01 GMT Approved: spell@seq.uncwil.edu Lines: 1314 Checksum: 1855929244 (verify with brik -cv) Submitted-by: Marc Moline Posting-number: Volume 7, Issue 17 Archive-name: japanese.mm BEGIN_DOC japanese.doc the name : Japanese for your HP48 the version : 1.0 the author : Marc Moline the E-address : DavidW@fib.upc.es (Prefered) akcs.MarcM@hpcvbbs.cv.hp.com (the second one) the quote : "Do not expose your LaserWriter to open flame or fire" -Apple computer manual- WHY JAPANESE ? I'm trying to learn japanese by my own( very difficult thing, you know) To improve my reading of hiragana and katakana (the two sylabic alphabets in japanese) I did a program that wrote random words in japanese. I tried to read them and afterwards the calculator gave me that word. (Not that it ment anything, it was just a character recognizing program) Since I already had the fonts defined (hand made) I made a program that wrote the two alphabets. (I have a friend that uses it to make encripted crib notes) the disposition of the alphabets is the tipical one (see AN ITRODUCTION TO JAPANESE at the end of this document) WHAT DOES EACH PROGRAM DO ? ALPHA This program draws any of the two japanese sylabic alphabets. the sequence "0 ALPHA" will draw the katakana and "1 ALPHA" will show the hiragana sylabic WORDS This is the read-training program. To run it needs two figures in the stack: on level two you need to specify the length of the word to be writen. (a number five will indicate the program that it sholud write words 5 sylabes long) On level one you indicate the % of hiragana happening in the words. (A 100 would mean 'all hiragana', a 0 'all katakana') After puting these two figures in the stack, press WORDS (the S is not shown in the vars menu) FLSHCR A flash card program. Its data is in the variable 'CARDS'. It extracts a random card from 'CARDS', prints it in Japanese and, at a key press, shows the card solution. (* ATENTION!: The CARDS file are the cards for the FLSHCR program *) CARDS This var contains the data for the FLSHCR program. Its structure is that of a list that contains lists inside, each sub-list is a card, and its structure is: { # SolutionWord { ka na wo rd}} SolutionWord = The word that the FLSHCR program will give after a key press. Usually its translation. # = 0 means KATAKANA, 1 means HIRAGANA { ka na wo rd} = list which contains the word in sylabes Be sure to write it in LOWERCASE. This is to avoid confusion with things like RE that is both a sylabe and the REal command of the 48 See next part to know which sylabes are OK. To fully understand it see the example provided. This Var is NOT ROM-based, that means you can make your own CARDS and store it. The FLSHCR will seek it in the current directory and then each subdirectory up the path until the home dir. Some sample cards can be found in the CARDS file ex: CARDS { { Thank you 1 { do o mo}} { Mother 1 { o ka a sa n}} { No smoking 1 { ki n e n } } { Radio 0 { ra ji o } }} DOES THIS THING WORK PROPERLY ? When I write a program first I try to make a short code then I shorten it by "Spaggheti Proramming" (Put everything you need in the right order on the stack and operate with it sequentialy instead of adding operators to the stack as you need them, place them in its correct place using SWAP, ROLL, ROT, etc. and THEN operate) to speed up I also do things like << 2 3 0 wait + >> instead of << 0 wait 2 3 + >> because a 0 WAIT sentence is suposed to let the user take a look at screen therefor I prefear to use part of that time for doing some calculations or preparing the stack instead of forcing the user to wait after the pause. The drawback is that if the user presses the ON/ATTN key the stack appears with a lot of trash. Now the REAL PROBLEM is that I don't have provided a way out for those programs, and you have to quit pressing the ON key ( what a lazy programmer I am!. Well, not so, no (User)pain no (User)gain => no money no custom_like programming.) NO, NOT YET ANOTHER LIBRARY !!? I post both the library version and the source. I find more interesting the library because it runs faster and because having a almost 60 vars directory is ugly HAS SOME ONE READ THIS FAR ? I Would apreciate any comments, sugestions, font improving, etc. If provided any interest I'll post a Hangman program in japanese using the same CARDS and fonts and all. Internet E-Mail: DavidW@fib.upc.es (prefered) akcs.MarcM@hpcvbbs.cv.hp.com (I do no read it so often) INTRODUCTION TO JAPANESE The Japanese use three alphabets simultaniously: the Kanji or Chinese ideograms, and the sylabaries Hiragana and Katakana. With the first they make the radicals of the words and compound words. Originally they used over than 7000, but after the II World War the Japanese governament published a list of the 1850 chars that were most common (Tohyoh Kanjis), they were the only kanji compulsory to know and that could appear in the newspapers. Afterwards this list was modified and about a 168 old kanjis were rescued and included to the list and eleven or so were deleted giving the JohYoh Kanjis List. This list is the one Japanese people use today, even that in no-newspaper publications like books and magazines use kanjis that are not in the list. The kanjis can be read with japanese pronunciation (kun-yomi) or the chinese pronunciation (on-yomi) usually words are read in kun-yomi and the on-yomi is used in compound words, but as it always happens, there are many exceptions. The hiragana and the katakana are the two sylabaries which are also derived from chinese writing. The hiragana is used basicaly to start reading at school, for writing sufixes and as many gramatical helping particles that japanese uses and when you don't know which kanji is the correct one for a determinated word or that it doesn't exist. On the other hand the katakana is mainly used to transcript occidental words such as names or noelogisms ( Joe or television would be writen in katakana). The japanese script in romanic characters in called Romaji. There are several Romaji systems like the Nihon-shiki or the Hepburn. The CARDS of the FLSHCR program should be writen in Romaji Hepburn. I did it so because it's phonetical transcription is most similar to my lenguage (Catalan) but I think is the same one used in English. The order of the Hiragana/Katakana is as follows: a ka sa ta na ha ma ya ra wa i ki shi chi ni hi mi ri u ku su tsu nu fu mu yu ru n e ke se te ne he me re o ko so to no ho mo yo ro wo Apart of this 46 basic sounds exist the Dokuon or impure sounds, derived from the softening of certain kanas: therefore the 't' turns into 'd', the 'k' into 'g', the 's' into 'z' and the 'h' into 'b' or 'p' depending if you add a " or a x like so: ka" = ga sa" = za ta" = da ha" = ba hax = pa ki" = gi si" = ji ti" = ji hi" = bi hix = pi ku" = gu su" = zu tu" = zu fu" = bu fux = pu ke" = ge se" = ze te" = de he" = be hex = pe ko" = go so" = zo to" = do ho" = bo hox = po About the Hepburn system a few remarks: In Japanese exist long vowel like the 'o' or the 'u' their sound is like 'oh' or 'uh' and is denoted in romaji with a score above the vowel like: _ but ASCII doesn't allow it, so it is cho not implemented in the program. The best thing is to repeat the vowel: cho o There are also a common group of demidiphthongs which are (in Romaji Hepburn) chi + ya = cha chi + yo = cho chi + yu = chu shi + ya = sha shi + yo = sho shi + yu = shu ki + ya = kya ki + yo = kyo ki + yu = kyu ji + ya = ja ji + yo = jo ji + yu = ju gi + ya = gya gi + yo = gyo gi + yu = gyu Phonetical equivalents in Romaji Hepburn: k like in Kilo s like in Sit t like in Tight n like in Now m like in Motor w like in Valey y like in Yo-Yo n like in Not d like in Danny h like in Hopper p like in Pillow b like in But g like in Game ch like in CHat j like in Jumbo sh like in SHow z like in THanks r is a combination of 'r' and 'l'. Put your mouth to say Erik and say EDDIC a like in fAther i like in macaronI u like in zulU e like in Extra o like in solO Although somtimes the 'i' and 'u' sounds are not fully sounded, usually at the end of a verb : 'desu' (to be) sounds like 'des' I could continue and write a book (many people do!) so if you want to learn japanese buy a book, go take japanese classes or even better buy a one way ticket to japan. ******************************************************************************* As usual, I have no responsability if this software produces you any ulcers, memory loss, data destruction, exam failing, keyboard malfunction, cough, hiccoughs, sneeze, snif, sob or whatsoever. END_DOC BEGIN_RPL Japanese.rpl %%HP: T(3)A(D)F(.); DIR WORDS \<< 100 / DUP { } 10 5 1 \-> L PH AL WORD XCO XW QUE \<< ERASE { # 0d # 0d } PVIEW 0 0 1 L FOR H DO KANA 1 RAND 50 * + IP GET IF DUP 'SP' SAME THEN DROP 0 ELSE 1 END UNTIL END RAND AL + IP 'PH' STO XCO SWAP 30 OVER EVAL OBJ\-> DROP2 IF PH 1 == THEN SWAP END DROP SIZE SWAP B\->R 'XW' STO XW 2 + 'XCO' STO+ B\->R - SWAP 'QUE' STO DUP2 QUE EVAL OBJ\-> DROP DUP SIZE RAND * 1 + IP DUP 'QUE' STO GET WORD SWAP + 'WORD' STO PH DIBU IF 1 QUE == THEN DROP2 ELSE SWAP XW + SWAP 4 'XCO' STO+ IF 2 QUE == THEN 'B' ELSE 'P' END EVAL DUP PH DIBU END NEXT WORD 1 \->GROB 0 WAIT DROP DUP PH 100 * DIBU 0 L * IP WAIT CLEAR L AL WORDS \>> \>> ALPHA \<< \-> ALPH \<< ERASE { # 0d # 0d } PVIEW KANA OBJ\-> ROLLS 0 9 FOR I 0 4 FOR J I 13 * 1 + J 12 * 1 + ROT EVAL OBJ\-> DROP2 ALPH DIBU NEXT NEXT 0 WAIT DROP2 \>> \>> FLSHCD \<< PICT PURGE { # 0d # 0d } PVIEW PICT { # 0d # 0d } CARDS DUP SIZE RAND * 1 + IP GET OBJ\-> DROP 2 \-> DC LT CN \<< 1 LT SIZE FOR Y LT Y GET -5 \-> WD Z \<< { "a" "i" "u" "e" "o" "n" } WD \->STR DUP SIZE 1 - DUP SUB POS 'Z' STO+ DO KANA 5 'Z' STO+ Z GET EVAL OBJ\-> DROP WD POS IF DUP THEN DUP ELSE DROP DROP2 0 END UNTIL END \>> ROT ROT IF DC THEN SWAP END DROP CN 20 ROT 0 0 DIBU 11 'CN' STO+ IF DUP 1 \=/ THEN CN 3 - 20 ROT IF 2 == THEN B ELSE P END 0 0 DIBU 3 'CN' STO+ ELSE DROP END NEXT \>> 0 WAIT DROP 1 \->GROB GOR 0 WAIT DROP \>> KANA { A I U E O KA KI KU KE KO SA SHI tSU SE SO TA CHI TSU TE TO NA NI NU NE NO HA HI FU HE HO MA MI MU ME MO YA SP YU SP YO RA RI RU R\201 RO WA SP N SP WO N } DIBU \<< IF 1 == THEN SWAP END DROP \-> X Y O \<< PICT { } X R\->B + Y R\->B + O GXOR \>> \>> A { GROB 8 8 FF04828080404030 GROB 9 10 80008000E30080008B00CC00A41092109110E800 { a } } I { GROB 8 9 040403814131010101 GROB 8 9 22151418181828A844 { i } } U { GROB 7 9 8080F7141422028170 GROB 6 10 C12200C1320202018070 { u } } E { GROB 9 8 0000EF000100010001000100F7000810 GROB 7 10 608100F1020183C22214 { e } } O { GROB 8 9 0101FF018141211181 GROB 9 10 40004800F90040104000C7006800580054002200 { o } } KA { GROB 8 9 4040FF484824242413 GROB 9 10 400080008400F90042102210221011000100C000 { ka ga } } KI { GROB 7 9 2021C0605483E01101 GROB 6 9 20F04080E3012210E3 { ki gi } } KU { GROB 6 9 20E322121101808040 GROB 5 10 01804020101020408001 { ku gu } } KE { GROB 8 9 2020EF221211018060 GROB 8 9 02129F121212125231 { ke ge } } KO { GROB 8 8 FF0808080808FF08 GROB 9 9 C3003C0000100800000020001000E8100700 { ko go } } SA { GROB 8 8 4242FF4242010180 GROB 6 10 2040F3808001012210E1 { sa za } } SHI { GROB 8 8 2040002844028170 GROB 7 9 0020202020202221C0 { shi ji } } tSU { GROB 7 7 F7020180412214 GROB 7 10 8080F780E09090E08040 { su zu } } SE { GROB 8 8 4040FF4442404087 GROB 9 9 44004400FF10440044004400420040008300 { se ze } } SO { GROB 7 8 0414240202018040 GROB 8 10 1423804EE311C02028C7 { so zo } } TA { GROB 6 9 20E322125181018060 GROB 9 10 40004000FF10400040004E10400020002E102000 { ta da } } CHI { GROB 7 9 0201E101F701808040 GROB 8 10 8040F7402027A8683814 { chi ji } } TSU { GROB 8 8 0898290404020180 GROB 10 8 00000C10832070200020002008100700 { tsu zu } } TE { GROB 7 8 E300F78080804040 GROB 8 8 FF038040201028C7 { te de } } TO { GROB 6 8 404040C043404040 GROB 8 10 10284681402010101CE3 { to do } } NA { GROB 7 9 808080F78080404020 GROB 9 10 40004200C9007010400040104B002500AC002310 { na } } NI { GROB 7 7 00E3000000F700 GROB 8 9 10931C14101090B718 { ni } } NU { GROB 7 7 F7040482038374 GROB 10 8 110029102720C120C020A91096106C20 { nu } } NE { GROB 7 9 C001F70281C2A49080 GROB 9 9 40004000EC00D2104110C0106E007D005610 { ne } } NO { GROB 7 8 0202020101804020 GROB 10 9 0000CF00211011201120112011202110C800 { no } } HA { GROB 8 7 42442428180000 GROB 8 10 1212129F121292535BA4 { ha ba pa } } HI { GROB 6 8 10109370101010E3 GROB 9 8 E2005C0024102400140012002200C100 { hi bi pi } } FU { GROB 7 7 F7040402028170 GROB 9 8 810042000200AB001210040044008300 { fu bu pu } } HE { GROB 9 6 00000000C00023001C000010 GROB 10 6 00000000C00023001C001030 { he be pe } } HO { GROB 7 9 8080F78080A29480C0 GROB 8 10 129F12129F1292535BA4 { ho bo po } } MA { GROB 9 8 0000FF10080084000300020004000000 GROB 8 10 01C70101E70161919966 { ma } } MI { GROB 6 8 6081006081006083 GROB 10 9 E000070002100900CF00A810942064000200 { mi } } MU { GROB 9 7 000004000200030084000800FF10 GROB 9 8 4000FD004010E0005100511061100F10 { mu } } ME { GROB 6 8 010121C080412210 GROB 10 8 12009F00621061206120D02091106800 { me } } MO { GROB 8 8 C70101FF0101010E GROB 6 10 4040F14040F140424281 { mo } } YA { GROB 9 8 40004C10C310B8008400800001000100 GROB 10 8 210029104720C0206020501080008000 { ya } } YU { GROB 9 7 00000000C300020002000200FF10 GROB 9 8 1D0012101310921052105A0037001100 { yu } } YO { GROB 7 7 F70404C70404F7 GROB 8 10 808001010F0161919966 { yo } } RA { GROB 7 8 F700F7040201C030 GROB 7 10 70811010935434040203 { ra } } RI { GROB 5 8 1111111111018060 GROB 7 8 4444444444C44201 { ri } } RU { GROB 8 8 0121414949251301 GROB 6 10 F1018040F102221211E0 { ru } } R\201 { GROB 7 7 14141412129170 GROB 10 9 40004000EC10D2104900E800680078205010 { re } } RO { GROB 7 8 F71414141414F714 GROB 6 10 F1018040F102020201E0 { ro } } WA { GROB 7 7 F7141422028170 GROB 10 9 40004000EC10D2204120E020601070105800 { wa } } N { GROB 8 7 20400804028170 GROB 8 9 020101808243C26A34 { n } } WO { GROB 7 7 F704F702028170 GROB 7 9 80E14020A1609413E5 { wo } } B GROB 4 3 A0A0A0 P GROB 4 3 40A040 SP { GROB 1 1 00 GROB 1 1 00 { } } CARDS { { TURTLE 1 { ka me } } } PPAR { (0,0) (130,63) X 1 (0,0) FUNCTION Y } END END_RPL ---------------------------------------------------------------------------- BEGIN_DOC Cards.doc FLSHCR data for the Japanese.lib See Japanese.doc for more info - Marc Moline - END_DOC BEGIN_RPL Cards.rpl %%HP: T(1)A(D)F(.); { { umbrella 1 { ka sa } } { pencil 1 { e n pi su } } { hospital 1 { bi yo u i n } } { telephone 1 { de n wa } } { pen 0 { pe n } } { newspaper 1 { shi n bu n } } { magazine 1 { za su shi } } { money 1 { o ka ne } } { what? 1 { na ni } } { who? 1 { da re } } { where? 1 { do ko } } { whose? 1 { da re no } } { river 1 { ka wa } } { mountain 1 { ya ma } } } END_RPL