From: se_lipta@rcvie.co.at (Jaroslav Liptak)
Subject: Accents (was Re: Prague Castle - Why?)
Reply-To: se_lipta@rcsw27.UUCP (Jaroslav Liptak)
Organization: Alcatel Austria - Elin Research Center, Vienna
Date: Wed, 9 Sep 1992 13:09:46 GMT

In article <25646@castle.ed.ac.uk> henry@castle.ed.ac.uk (J J Nebrensky) writes:
>
>... (Prague Castle stuff deleted)
>
>p.p.s Before CAROLINA, COMENIA etc. etc. get broadcast to the world, any
>chance of deciding on a standard way to represent accents in ASCII ?
>(or telling us out here what it is (or where the FAQ list is))?
>

I find it a nice idea to make the accents representation a FAQ. Some time
ago I proposed a postfix-based convention for Czech/Slovak accents and
I posted a short TeX filter. For those of you not more able to recall
articles 18 and 19 of soc.culture.czecho-slovak, I have compiled a short
re-post. When the number of accent representation requests arises, it
can be perhaps worth a short discussion on this forum.

Mysli'm si, z*e oznac*it* reprezenta'ciu diakritiky za C*KO (c*asto kladenu'
ota'zku) je dobry' na'pad. Pred c*asom som navrhoval pre c*eske' a slovenske'
diakriticke' znamienka postfixovu' konvenciu a uverejnil som aj kra'tky
filter pre TeX. Pre va's vs*etky'ch, ktori' uz* nemaju' moz*nost* vra'tit*
sa k c*la'nkom 18 a 19 zo soc.culture.czecho-slovak, zostavil som kra'tku
rekapitula'ciu. Az* sa ota'zky ty'kaju'ce sa reprezenta'cie diakritiky
stanu' hojnejs*ie, azda to bude sta't* za trochu diskusie v ra'mci tohto
fo'ra.

The idea is based on a postfix notation of the diacritics, where

	* represents the "hacek"/"makcen" accent
	' represents the "carka"/"dlzen" accent
	" represents the "prehlaska"  ("Umlaut") accent
	^ represents the  Slovak "vokan" accent (for the "o")
	  used also for the Czech accent "krouzek" (for the "u")


and the additional character set looks like:


			Samohla'sky (wowels):

		a' a" e' e* i' y' o' o^ o" u' u^ u"

		A' A" E' E* I' Y' O' O^ O" U' U^ U"


			Spoluhla'sky (consonants):

		c* d* l' l* n* r' r* s* t* z*

		C* D* L' L* N* R' R* S* T* Z*

For anyone who wants to try out the transliteration suggested,
I provide a primitive TeX filter. I know, there can be much said
about aesthetics, but let us fulfil the readability goal first...
You can use the sample text above.

O/______________________   cut here ______________________________________
O\

/*
 *
 *	Converts simulated accents into TeX sequences.
 *	Slovak characters handled properly; there are some problems
 *	with the Czech <u s krouzkem> - simulated by dot accent
 */

#include <ctype.h>
#include <stdio.h>


main()
{
	totex();
}
 
 totex()
 {
	register	char	c;
	register	char	tempc;
	register	char	*t;
			char	tempc2;
			int	diacrit;

	
 
	while ((c = getc(stdin)) != EOF) {
		diacrit = 0;
		if (isalpha(c)) {
			tempc = getc(stdin);
			switch (tempc) {
			case '\'':
				diacrit = 1;
				switch (c) {
				case 'a': t = "\\'a"; break;
				case 'A': t = "\\'A"; break;
				case 'r': t = "\\'r"; break;
				case 'R': t = "\\'R"; break;
				case 'i': t = "\\'\\i ";
	 				  if ( isspace(tempc2 = getchar()) )
						t = "\\'\\i \\ ";
					  ungetc(tempc2, stdin);
					  break;
				case 'I': t = "\\'I"; break;
				case 'l': t = "\\'l"; break;
				case 'L': t = "\\'L"; break;
				case 'o': t = "\\'o"; break;
				case 'O': t = "\\'O"; break;
				case 'u': t = "\\'u"; break;
				case 'U': t = "\\'U"; break;
				case 'e': t = "\\'e"; break;
				case 'E': t = "\\'E"; break;
				case 'y': t = "\\'y"; break;
				case 'Y': t = "\\'Y"; break;
				default: ungetc(tempc, stdin); 
					 diacrit = 0; 
					 break;
				}
				break;
			
			case '*':
				diacrit = 1;
				switch (c) {
				case 'c': t = "\\v c"; break;
				case 'C': t = "\\v C"; break;
				case 'd': t = "d\\kern-.15em'"; break;
				case 'D': t = "\\v D"; break;
				case 'e': t = "\\v e"; break;
				case 'E': t = "\\v E"; break;
				case 'l': t = "l\\kern-.15em'"; break;
				case 'L': ARD
EDITt = "L\\kern-.2em'"; break;
				case 'n': t = "\\v n"; break;
				case 'N': t = "\\v N"; break;
				case 'r': t = "\\v r"; break;
				case 'R': t = "\\v R"; break;
				case 's': t = "\\v s"; break;
				case 'S': t = "\\v S"; break;
				case 't': t = "t\\kern-.2em'"; break;
				case 'T': t = "\\v T"; break;
				case 'z': t = "\\v z"; break;
				case 'Z': t = "\\v Z"; break;
				default: ungetc(tempc, stdin);
					 diacrit = 0; 
					 break;
				}
				break;

			case '"':
				diacrit = 1;
				switch (c) {
				case 'u': t = "\\\"u"; break;
				case 'U': t = "\\\"U"; break;
				case 'o': t = "\\\"o"; break;
				case 'O': t = "\\\"O"; break;
				case 'a': t = "\\\"a"; break;
				case 'A': t = "\\\"A"; break;
				default: ungetc(tempc, stdin); 
					 diacrit = 0;
					 break;
				}
				break;

			case '^':
				diacrit = 1;
				switch (c) {
				case 'u': t = "\\.u"; break;
				case 'U': t = "\\.U"; break;	
				case 'o': t = "\\^ o"; break;
				case 'O': t = "\\^ O"; break;
				default: ungetc(tempc, stdin); 
					 diacrit = 0;
					 break;
				}
				break;

			default:
				ungetc(tempc, stdin);
				break;
			}
		}
		if (diacrit)
			printf("%s", t);
		else
			printf("%c", c);
	}
}


O/______________________   cut here ______________________________________
O\

No bells and whistles. Just stdin to stdout. No copyright. No warranty.

Any comments?

Have fun

Jaro



-- 
---------------------------------------------------------------------------
Jaroslav Liptak, Software Eng. Group            Phone  +431 39 16 21 262
Alcatel Austria - Elin Research Centre    0"0   Fax    +431 39 14 52
Ruthnergasse 1-7, A-1210 Wien, Austria   ( V )  Telex  113297 rcvie a
                                          | |   e-mail se_lipta@rcvie.co.at
------------------------------------------m-m------------------------------

Newsgroups: soc.culture.czecho-slovak