Yiddish Mailing List, Issue #45 July 12, 1991 331 lines =============================== Yidish-vokh in Copake (David Sherman) Software for Groyse Oysyes: yidtype.c (Refoyl Finkel) ------------------------ Digest-Message: 45/1 From: dave@lsuc.on.ca (David Sherman) Date: Fri Jul 12 15:31:12 EDT 1991 Subject: Yidish-vokh Yugntruf is having their annual Yidish-vokh in Copake, NY from August 28 to September 3. I didn't receive the literature yet (seems to have gotten lost in the mail), but I got a phone call this morning about it, because they have to finalize the number of people who are going to come to make reservations with the camp. I wrote about Yidish-vokh from past years in mail.yiddish #8, 11, 12 and 27. It's a wonderful place to speak Yiddish for a week. To get more information and reserve a space, call Yugntruf at 212-787-6675, or call Dovid Braun at home, 201-947-7605. ------------------------ Digest-Message: 45/2 From: Raphael Finkel Date: Mon, 8 Jul 1991 15:05:46 -0400 Subject: Re: hebtype.c -> yidtype.c Gut, ot iz a ksav-yad men ken nitsn. Oykh is dos nemlekh mit anonim-'ftp' fun f.ms.uky.edu:pub/unix/yidtype.2.1.tar.Z. [Note: this is the last message in this issue. If you don't want the software, you can stop reading now. - DS] ---- yidtype.c /**********************************************************************/ /* yidtype.c -- A program which generates ASCII based Yiddish text. */ /* */ /* This is version 2.1, released (?) July 8, 1991, raphael@ms.uky.edu */ /* mods: has some Yiddish-specific characters, modified the appearance */ /* of some characters, added some punctuation, revised the mapping between */ /* English and Yiddish. */ /* */ /* Based on version 1.0 of hebtype.c, released on June 11th, 1991. */ /* "Hebrew Type" was written by Lee Lawrence who hereby declares it */ /* to be public domain and may be redistributed, provided that no fee */ /* is ever charged. I also politely request that any programs which */ /* are derived from this code or Hebrew font refer to Lee Lawrence */ /* as the originator. If you have any suggestions, or if you find */ /* any bugs, or make any enhancements that I might be interested in, */ /* you can reach me by e-mail at leel@cs.colorado.edu */ /* */ /* I hope you enjoy this program. If so, let me know. */ /**********************************************************************/ #include #define AVGCLEN 4.5 /* average hebrew character length */ int MAXCOL=79; /* maximum number of useable output columns */ char *aleph[] = { /* NOTE: shifting is because of doubled backslash */ " _ |_ ___ ___ _ _ _ ____ \\_ _ __ ____ __ __ _ _ ", " \\/ | | | | | | /| | | |\\ | | | | | ,\\| ", " | _| / | ___| |__| | | | | | | | /| __|_ | \\ ", " | ", " ___ _ _ _ __ ___ _ _ _ _ __ __ _ _ ___ _ _ ____ // ", " | | | | | | , / | | \\| |_ | |_ | | | | | | | | | ", " _| | |/_/ | |/ |/ __\\ | ___| _|/ |_/ | _| |__| o ", " | | | | ", " _ _ _ _ _ _ _ _ _ _ _ / _ | ", " | | | | | | ,\\| ,\\| | o o | | | ", " | | ___ |_\\ |_\\ . / / o / o ", " | o "}; char *trans[3] = { "mlXxytHzwhdgb- ","TSrkCcFfesNnM.\"", "vIAaoi,;:'?! " }; /* the mapping */ int pos[3][16] = { 0,5,9,14,19,22,27,32,36,39,43,48,51,56,60,63, 0,5,11,15,19,23,27,32,37,42,47,50,53,58,60,63, 0,5,10,15,19,23,26,28,30,32,34,38,40}; main (argc,argv) int argc; char **argv; { extern int optind; extern char *optarg; int c,i,j,k,len,rlen,rpos,p,outpos,lnum,flush=0,center=1; char read[1024],line[1024],out[4][1024],*fill; while ((c = getopt(argc,argv,"lcrw:")) != EOF) { /* handle options */ switch (c) { case 'l': /* left flush */ flush=0; center=1; break; case 'c': /* centered text */ flush=1; center=2; break; case 'r': /* right flush */ flush=1; center=1; break; case 'w': /* set width */ MAXCOL = atoi(optarg); break; default: fprintf(stderr, "Usage: %s [-lcr] [-w width]\n",argv[0]); exit(2); break; } } fill = (char *) malloc(MAXCOL*sizeof(char)); /* to position output */ for (i=0;i=0;i--) { /* process characters in reverse */ lnum = 0; if (index(trans[lnum],line[i])==NULL) lnum++; /* found 1st? */ if (index(trans[lnum],line[i])==NULL) lnum++; /* found 2nd? */ if (index(trans[lnum],line[i])==NULL) continue; /* found 3rd? */ p = 15-strlen(index(trans[lnum],line[i])); /* get position */ for (k=pos[lnum][p];k') out[0][outpos-1]='.';/* shin */ if (line[i]=='S'&&line[i+1]=='<') out[0][outpos-5]='.';/* sin */ } for (j=0;j<4;j++) out[j][outpos] = '\0'; /* null terminate output */ fill[flush*(MAXCOL-strlen(out[0]))/center] = '\0'; printf("%s%s\n%s%s\n%s%s\n%s%s\n\n",fill,out[0],fill,out[1], fill,out[2],fill,out[3]); fill[flush*(MAXCOL-strlen(out[0]))/center] = ' '; /* undo fill */ } } exit(0); } /* This subroutine crudely guesses whether or not the */ /* next full word will fit on the current output line. */ /* The routine is overly conservative, and should eventually be rewritten. */ breakitup(read,line,rpos) int *rpos; char *read,*line; { int i,last,nextword,stop; last = strlen(read); while ((last - *rpos)*AVGCLEN > MAXCOL) last--; stop = last; /* stop is the maximum chars that will actually fit */ nextword = last; /* nextword will become the new rpos starting position */ if (last!=strlen(read)) { while (read[--last]!=' ' && last >= *rpos); /* skip to start of the word */ nextword = last+1; } if (last < *rpos) { /* word is too long so print it truncated */ last = stop; nextword = stop; } for (i = *rpos;i" and "<" respectively. - A "vav" can be pronounced "oo" (shuruq) by following it with "^", or it can be pronounced "oh" (cholam) by following it with "%". THE COMMAND LINE OPTIONS: The generated text can be lined up along the right margin, or centered. The default is no alignment, i.e. left margin. The options for left, right, and center alignment are -l -r and -c You should only use one of these on the command line. You can change the width to be larger or smaller than the default of 79 columns by using the -w option. On many devices, printing in the last column forces a line feed... this is why the default is 79 and not 80. Example: Print text centered using only forty columns and write all the output to the file "outfile". Type: yidtype -c -w 40 > outfile BUGS: The automatic word-wrap is overly conservative and doesn't take a chance that long lines will not mess up the output. Not all pronunciation symbols are implemented, nor are they planned. recast.sed -- a script for converting reasonable input formalism into what yidtype expects. usage: sed -f recast.sed (takes from standard input, goes to standard output) what it does: p for pe i for yud without the pintl; you still get the pintl if you say "yi" kh for khes ts for tsadi u for vov ay for pasakh tsvey yud ey for tsvey yud oy for vov-yud sh for shin initial shtumer alef added when needed use | to prevent these rules: tes-samekh is t|s; |ay prevents shtumer alef at start of word ------------------------ SOF FUN NUMER 45 ------------------------ David (Daniel Moishe) Sherman, Toronto Moderator, mail.yiddish dave@lsuc.on.ca attcan!lsuc!dave@uunet.uu.net uunet!attcan!lsuc!dave {AT&T sites}!att!lsuc!dave