Add translation

This commit is contained in:
kozika 2026-06-20 15:26:59 +09:00
commit 8b001e8876
No known key found for this signature in database
GPG key ID: EBD0888941CCB50E
7 changed files with 65 additions and 28 deletions

View file

@ -133,21 +133,21 @@ void output_knj(FILE* fp, u_char* p, int l) {
while(l > 0) { while(l > 0) {
switch(*p & KANJIMODEMASK) { switch(*p & KANJIMODEMASK) {
case ZENHIRAASSYUKU: case ZENHIRAASSYUKU:
fprintf(fp, "\244\322%d", (*p++ & 0x0f) + 1); fprintf(fp, COMPHIRAGANA, (*p++ & 0x0f) + 1);
l--; l--;
break; break;
case ZENKATAASSYUKU: case ZENKATAASSYUKU:
fprintf(fp, "\245\253%d", (*p++ & 0x0f) + 1); fprintf(fp, COMPKATAKANA, (*p++ & 0x0f) + 1);
l--; l--;
break; break;
case KANJIASSYUKU: case KANJIASSYUKU:
fprintf(fp, "\260\265%1x", (*p++ & 0x0f)); fprintf(fp, COMPKANJI, (*p++ & 0x0f));
l--; l--;
break; break;
case LEADINGHANKAKU: case LEADINGHANKAKU:
#ifndef USEHANKAKUINDICT #ifndef USEHANKAKUINDICT
l = 0; l = 0;
fprintf(stderr, "\244\252\244\253\244\267\244\244"); fprintf(stderr, COMPWRONG);
#else #else
fputc(*p++, fp); fputc(*p++, fp);
l--; l--;
@ -162,7 +162,7 @@ void output_knj(FILE* fp, u_char* p, int l) {
l--; l--;
break; break;
case AIATTRIBUTE: case AIATTRIBUTE:
fprintf(fp, "\302\260%1x", (*p++ & 0x0f)); fprintf(fp, COMPATTR, (*p++ & 0x0f));
l--; l--;
fprintf(fp, "%02x", *p++); fprintf(fp, "%02x", *p++);
l--; l--;

View file

@ -33,6 +33,7 @@
* $SonyDate: 1994/08/17 01:50:26 $ * $SonyDate: 1994/08/17 01:50:26 $
*/ */
#include "sj4_dict_const.h"
#include "sj4_dict_struct.h" #include "sj4_dict_struct.h"
#include "sj4mkdic.h" #include "sj4mkdic.h"
@ -65,7 +66,7 @@ makeassyuku(int num) {
arec = (AssyukuRec*)Malloc(sizeof(AssyukuRec)); arec = (AssyukuRec*)Malloc(sizeof(AssyukuRec));
if(!arec) { if(!arec) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\302\255\244\352\244\336\244\273\244\363\n"); fprintf(stderr, MEMNOTENOUGH);
exit(1); exit(1);
} }
@ -199,12 +200,12 @@ makehindo(u_char* ptr, int len, int alen) {
hrec = (HindoRec*)Malloc(sizeof(HindoRec)); hrec = (HindoRec*)Malloc(sizeof(HindoRec));
if(!hrec) { if(!hrec) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\302\255\244\352\244\336\244\273\244\363\n"); fprintf(stderr, MEMNOTENOUGH);
exit(1); exit(1);
} }
p = (u_char*)Malloc(len); p = (u_char*)Malloc(len);
if(!p) { if(!p) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\302\255\244\352\244\336\244\273\244\363\n"); fprintf(stderr, MEMNOTENOUGH);
exit(1); exit(1);
} }
hrec->klen = len; hrec->klen = len;
@ -256,7 +257,7 @@ set_hindo(u_char* ptr, int len, int alen) {
if(i) { if(i) {
if(hindo_num >= MAXHINDONUMBER) { if(hindo_num >= MAXHINDONUMBER) {
fprintf(stderr, "\311\321\305\331\245\306\241\274\245\326\245\353\244\254\244\242\244\325\244\354\244\336\244\267\244\277\n"); fprintf(stderr, TABLEOVERFLOW);
exit(1); exit(1);
} }
@ -456,7 +457,7 @@ end:
if(len <= 2) continue; if(len <= 2) continue;
while(len > 0) { while(len > 0) {
if((*p & KANJIMODEMASK) == OFFSETASSYUKU) { if((*p & KANJIMODEMASK) == OFFSETASSYUKU) {
printf("\245\252\245\325\245\273\245\303\245\310\260\265\275\314\244\362\264\336\244\340 %d\n", i); printf(CONTAINOFFSETCOMP, i);
} }
j = codesize(*p); j = codesize(*p);
len -= j; len -= j;

View file

@ -61,7 +61,7 @@ make_divrec() {
p = (DivList*)Malloc(sizeof(DivList)); p = (DivList*)Malloc(sizeof(DivList));
if(!p) { if(!p) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\302\255\244\352\244\336\244\273\244\363\n"); fprintf(stderr, MEMNOTENOUGH);
exit(1); exit(1);
} }
p->child = NULL; p->child = NULL;
@ -160,7 +160,7 @@ knjofscvt(u_char* ptr, int len, int* ret) {
p = (u_char*)Malloc(i); p = (u_char*)Malloc(i);
if(!p) { if(!p) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\311\324\302\255\244\267\244\336\244\267\244\277"); fprintf(stderr, MEMINSUFFICIENT);
exit(1); exit(1);
} }
for(q = p, dl = parent.child; dl; dl = dl->child) { for(q = p, dl = parent.child; dl; dl = dl->child) {
@ -190,7 +190,7 @@ knjcvt(u_char* ptr, int len, int* ret) {
p = (u_char*)Malloc(i); p = (u_char*)Malloc(i);
if(!p) { if(!p) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\311\324\302\255\244\267\244\336\244\267\244\277"); fprintf(stderr, MEMINSUFFICIENT);
exit(1); exit(1);
} }
for(q = p, dl = parent.child; dl; dl = dl->child) { for(q = p, dl = parent.child; dl; dl = dl->child) {
@ -206,7 +206,7 @@ knjcvt(u_char* ptr, int len, int* ret) {
free_divlist(parent.child); free_divlist(parent.child);
if(i != q - p) { if(i != q - p) {
printf("\244\263\244\263\n"); printf(CVTHERE);
exit(1); exit(1);
} }

View file

@ -33,6 +33,7 @@
* $SonyDate: 1994/06/03 08:00:39 $ * $SonyDate: 1994/06/03 08:00:39 $
*/ */
#include "sj4_dict_const.h"
#include "sj4_dict_struct.h" #include "sj4_dict_struct.h"
#include "sj4mkdic.h" #include "sj4mkdic.h"
@ -153,7 +154,7 @@ makekanji(int* yomi, int* kanji, int* atr, int* len) {
q = (u_char*)Malloc(pos); q = (u_char*)Malloc(pos);
if(!q) { if(!q) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\311\324\302\255\244\267\244\336\244\267\244\277"); fprintf(stderr, MEMINSUFFICIENT);
exit(1); exit(1);
} }
memcpy(q, ktmp, pos); memcpy(q, ktmp, pos);
@ -189,7 +190,7 @@ makeyomi(int* yomi) {
p = (u_char*)Malloc(i); p = (u_char*)Malloc(i);
if(!p) { if(!p) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\311\324\302\255\244\267\244\336\244\267\244\277"); fprintf(stderr, MEMINSUFFICIENT);
exit(1); exit(1);
} }
memcpy(p, tmp, i); memcpy(p, tmp, i);
@ -203,7 +204,7 @@ make_krec(u_char* kcode, int klen) {
krec = (KanjiRec*)Malloc(sizeof(KanjiRec)); krec = (KanjiRec*)Malloc(sizeof(KanjiRec));
if(!krec) { if(!krec) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\311\324\302\255\244\267\244\336\244\267\244\277"); fprintf(stderr, MEMINSUFFICIENT);
exit(1); exit(1);
} }
@ -222,7 +223,7 @@ make_hrec(int hinsi) {
hrec = (HinsiRec*)Malloc(sizeof(HinsiRec)); hrec = (HinsiRec*)Malloc(sizeof(HinsiRec));
if(!hrec) { if(!hrec) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\311\324\302\255\244\267\244\336\244\267\244\277"); fprintf(stderr, MEMINSUFFICIENT);
exit(1); exit(1);
} }
@ -239,7 +240,7 @@ make_drec(u_char* ycode) {
drec = (DouonRec*)Malloc(sizeof(DouonRec)); drec = (DouonRec*)Malloc(sizeof(DouonRec));
if(!drec) { if(!drec) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\311\324\302\255\244\267\244\336\244\267\244\277"); fprintf(stderr, MEMINSUFFICIENT);
exit(1); exit(1);
} }
@ -275,12 +276,12 @@ diff_ylen(DouonRec* drec) {
} }
if(*p1 == *p2) { if(*p1 == *p2) {
fprintf(stderr, "\305\371\244\267\244\244\306\311\244\337\244\316\306\261\262\273\270\354\245\326\245\355\245\303\245\257\244\254\244\242\244\353\n"); fprintf(stderr, HOMOPHONEBLOCK);
output_yomi(stderr, dprev->yptr); output_yomi(stderr, dprev->yptr);
fputc('\n', stderr); fputc('\n', stderr);
exit(1); exit(1);
} else if(*p1 > *p2) { } else if(*p1 > *p2) {
fprintf(stderr, "\306\311\244\337\244\316\275\347\275\370\244\254\244\252\244\253\244\267\244\244\n"); fprintf(stderr, WRONGREADORDER);
output_yomi(stderr, dprev->yptr); output_yomi(stderr, dprev->yptr);
fputc('\n', stderr); fputc('\n', stderr);
output_yomi(stderr, drec->yptr); output_yomi(stderr, drec->yptr);
@ -384,7 +385,7 @@ start:
return; return;
} else if(douon_ptr == NULL) { } else if(douon_ptr == NULL) {
fprintf(stderr, "\243\261\306\261\262\273\270\354\245\326\245\355\245\303\245\257\244\254\302\347\244\255\244\271\244\256\244\336\244\271\n"); fprintf(stderr, TOOLARGEBLOCK);
exit(1); exit(1);
} }
@ -476,11 +477,11 @@ void makelist(int* yomi, int* kanji, int hinsi, int* atr) {
for(krec = hrec->krec; krec; krec = krec->knext) { for(krec = hrec->krec; krec; krec = krec->knext) {
if((krec->klen == klen) && if((krec->klen == klen) &&
!memcmp(krec->kptr, kcode, klen)) { !memcmp(krec->kptr, kcode, klen)) {
fprintf(stderr, "\306\261\260\354\244\316\275\317\270\354\244\254\302\270\272\337\244\267\244\277\n"); fprintf(stderr, DUPECOMBINEDWORD);
fprintf(stderr, "\t\306\311\244\337:"); fprintf(stderr, DUPECOMBINEDWORDREAD);
output_int(stderr, yomi); output_int(stderr, yomi);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "\t\264\301\273\372:"); fprintf(stderr, DUPECOMBINEDWORDKANJI);
output_int(stderr, kanji); output_int(stderr, kanji);
fprintf(stderr, "\n"); fprintf(stderr, "\n");

View file

@ -33,6 +33,7 @@
* $SonyDate: 1994/06/03 08:00:42 $ * $SonyDate: 1994/06/03 08:00:42 $
*/ */
#include "sj4_dict_const.h"
#include "sj4mkdic.h" #include "sj4mkdic.h"
void* Malloc(unsigned size) { void* Malloc(unsigned size) {
@ -40,7 +41,7 @@ void* Malloc(unsigned size) {
p = malloc(size); p = malloc(size);
if(p == NULL) { if(p == NULL) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\263\316\312\335\244\307\244\255\244\336\244\273\244\363\244\307\244\267\244\277\241\243\n"); fprintf(stderr, MEMALLOCFAILED);
exit(1); exit(1);
} }
return p; return p;

View file

@ -33,6 +33,7 @@
* $SonyDate: 1994/08/17 01:50:26 $ * $SonyDate: 1994/08/17 01:50:26 $
*/ */
#include "sj4_dict_const.h"
#include "sj4_dict_struct.h" #include "sj4_dict_struct.h"
#include "sj4mkdic.h" #include "sj4mkdic.h"
@ -85,7 +86,7 @@ void set_ofsrec(u_char* ptr, int len, int ofs) {
if(i) { if(i) {
if(ofsrec_num >= MAXOFFSETNUMBER) { if(ofsrec_num >= MAXOFFSETNUMBER) {
fprintf(stderr, "\245\252\245\325\245\273\245\303\245\310\241\246\245\306\241\274\245\326\245\353\244\254\244\242\244\325\244\354\244\336\244\267\244\277\n"); fprintf(stderr, OFFSETTABLEOVERFLOW);
exit(1); exit(1);
} }
@ -144,6 +145,6 @@ real_ofsrec(u_char* ptr) {
if((*p)->offset == ofs) if((*p)->offset == ofs)
return *p; return *p;
fprintf(stderr, "real_ofsrec() \244\307\260\333\276\357\244\312\276\365\302\326 %x\n", ofs); fprintf(stderr, OFFSETILLEGALSTATE, ofs);
exit(1); exit(1);
} }

View file

@ -90,6 +90,20 @@
#define TOOMANYJOSI "Too many particles" #define TOOMANYJOSI "Too many particles"
#define NODATAINMAIN "Non-existent in main dictionary" #define NODATAINMAIN "Non-existent in main dictionary"
#define TOOMANYTARGET "Specify only one verb" #define TOOMANYTARGET "Specify only one verb"
#define MEMNOTENOUGH "Not enough memory\n"
#define TABLEOVERFLOW "Frequency table overflowed\n"
#define CONTAINOFFSETCOMP "Contains offset compression %d\n"
#define MEMINSUFFICIENT "Memory was insufficient"
#define CVTHERE "here\n"
#define MEMALLOCFAILED "Could not allocate memory.\n"
#define HOMOPHONEBLOCK "There is a homophone block with the same reading\n"
#define WRONGREADORDER "The reading order is wrong\n"
#define TOOLARGEBLOCK "One homophone block is too large\n"
#define DUPECOMBINEDWORD "A duplicate compound word exists\n"
#define DUPECOMBINEDWORDREAD "\tReading:"
#define DUPECOMBINEDWORDKANJI "\tKanji:"
#define OFFSETTABLEOVERFLOW "Offset table overflowed\n"
#define OFFSETILLEGALSTATE "Abnormal state in real_ofsrec() %x\n"
#else #else
#define ILLEGALFORMAT "\245\325\245\251\241\274\245\336\245\303\245\310\244\254\260\333\276\357\244\307\244\271" #define ILLEGALFORMAT "\245\325\245\251\241\274\245\336\245\303\245\310\244\254\260\333\276\357\244\307\244\271"
#define TOOLONGYOMI "\306\311\244\337\312\270\273\372\316\363\244\254\304\271\244\271\244\256\244\336\244\271" #define TOOLONGYOMI "\306\311\244\337\312\270\273\372\316\363\244\254\304\271\244\271\244\256\244\336\244\271"
@ -107,8 +121,27 @@
#define TOOMANYJOSI "\275\365\273\354\244\316\277\364\244\254\302\277\244\271\244\256\244\336\244\271" #define TOOMANYJOSI "\275\365\273\354\244\316\277\364\244\254\302\277\244\271\244\256\244\336\244\271"
#define NODATAINMAIN "\245\341\245\244\245\363\274\255\275\361\244\313\302\270\272\337\244\267\244\336\244\273\244\363" #define NODATAINMAIN "\245\341\245\244\245\363\274\255\275\361\244\313\302\270\272\337\244\267\244\336\244\273\244\363"
#define TOOMANYTARGET "\311\312\273\354\244\362\243\261\244\304\273\330\304\352\244\267\244\306\244\257\244\300\244\265\244\244" #define TOOMANYTARGET "\311\312\273\354\244\362\243\261\244\304\273\330\304\352\244\267\244\306\244\257\244\300\244\265\244\244"
#define MEMNOTENOUGH "\245\341\245\342\245\352\244\254\302\255\244\352\244\336\244\273\244\363\n"
#define TABLEOVERFLOW "\311\321\305\331\245\306\241\274\245\326\245\353\244\254\244\242\244\325\244\354\244\336\244\267\244\277\n"
#define CONTAINOFFSETCOMP "\245\252\245\325\245\273\245\303\245\310\260\265\275\314\244\362\264\336\244\340 %d\n"
#define MEMINSUFFICIENT "\245\341\245\342\245\352\244\254\311\324\302\255\244\267\244\336\244\267\244\277"
#define CVTHERE "\244\263\244\263\n"
#define MEMALLOCFAILED "\245\341\245\342\245\352\244\254\263\316\312\335\244\307\244\255\244\336\244\273\244\363\244\307\244\267\244\277\241\243\n"
#define HOMOPHONEBLOCK "\305\371\244\267\244\244\306\311\244\337\244\316\306\261\262\273\270\354\245\326\245\355\245\303\245\257\244\254\244\242\244\353\n"
#define WRONGREADORDER "\306\311\244\337\244\316\275\347\275\370\244\254\244\252\244\253\244\267\244\244\n"
#define TOOLARGEBLOCK "\243\261\306\261\262\273\270\354\245\326\245\355\245\303\245\257\244\254\302\347\244\255\244\271\244\256\244\336\244\271\n"
#define DUPECOMBINEDWORD "\306\261\260\354\244\316\275\317\270\354\244\254\302\270\272\337\244\267\244\277\n"
#define DUPECOMBINEDWORDREAD "\t\306\311\244\337:"
#define DUPECOMBINEDWORDKANJI "\t\264\301\273\372:"
#define OFFSETTABLEOVERFLOW "\245\252\245\325\245\273\245\303\245\310\241\246\245\306\241\274\245\326\245\353\244\254\244\242\244\325\244\354\244\336\244\267\244\277\n"
#define OFFSETILLEGALSTATE "real_ofsrec() \244\307\260\333\276\357\244\312\276\365\302\326 %x\n"
#endif #endif
#define COMPHIRAGANA "\244\322%d"
#define COMPKATAKANA "\245\253%d"
#define COMPKANJI "\260\265%1x"
#define COMPWRONG "\244\252\244\253\244\267\244\244"
#define COMPATTR "\302\260%1x"
#define HINSITANKAN cnvhinsi((u_char*)"\303\261\264\301") #define HINSITANKAN cnvhinsi((u_char*)"\303\261\264\301")
#define FALSE 0 #define FALSE 0