9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: mirtchov@cpsc.ucalgary.ca
To: 9fans@cse.psu.edu
Subject: [9fans] web-based bulgarian-english and english-bulgarian dictionary
Date: Thu,  6 Nov 2003 16:29:21 -0700	[thread overview]
Message-ID: <6e08851011f045080e1945623fb62232@plan9.ucalgary.ca> (raw)

[-- Attachment #1: Type: text/plain, Size: 799 bytes --]

Inspired by the little thesaurus script today's "pull" brought home,
this little script queries a relatively complete en/bg and bg/en
dictionary on the http://sa.dir.bg web site.

I've sent them an email to tell them about the wonders of utf-8, but I
doubt they'll switch from the venerable Windows-1251 cyrillic
encoding, so there's a key in the script for transliterating all
cyrillic queries, or if you wish you can type in cyrillic and it'll do
the transliteration for you.

also available at:

	http://pages.cpsc.ucalgary.ca/~mirtchov/p9/sadict/

I don't think this should make it in the default Plan 9 distribution,
unless Plan 9 becomes the OS of choice in Bulgaria in the next 30
minutes.

andrey

PS: I used it just now to check the meaning of 'venerable', it works :)

[-- Attachment #2: sadict --]
[-- Type: text/plain, Size: 1453 bytes --]

#!/bin/rc

# english-bulgarian translation:
#	sadict test

# bulgarian-english translation:
#	sadict TEST

# the web site switches between bulgarian and english translations
# based on whether it receives uppercase or lowercase letters
# to translate from bulgarian into english use the following transliteration
# key:

# key for translating from bulgarian to english (all capital letters
# are in english), as they would be written if you were typing on 
# a phonetic english-american keyboard.
# 
#	а	=	A
#	б	=	B
#	в	=	W
#	г	=	G
#	д	=	D
#	е	=	E
#	ж	=	V
#	з	=	Z
#	и	=	I
#	й	=	J
#	к	=	K
#	л	=	L
#	м	=	M
#	н	=	N
#	о	=	O
#	п	=	P
#	р	=	R
#	с	=	S
#	т	=	T
#	у	=	U
#	ф	=	F
#	х	=	H
#	ц	=	C
#	ч	=	` (or %60)
#	ш	=	[
#	щ	=	]
#	ъ	=	Y
#	ь	=	X
#	ю	=	|
#	я	=	Q

# sa.dir.bg outputs everything in window-1251 encoding, so we 
# use tr -s to substitute for proper unicode cyrillic

# sa.dir.bg gives 20 (sometimes less) similar words in a separate
# frame. I've left it there because I often find it useful and it just
# scroll off the top of the screen when it isn't.

# don't try capital letters, won't work!

query=`{echo $1 | 
	tr -s 'абвгдежзийклмнопрстуфхцшщъьюя' 'ABWGDEVZIJKLMNOPRSTUFHC\[\]YX\|Q' |
	sed 's/ч/%60/g'
}



hget 'http://sa.dir.bg/cgi-bin/sabig.cgi?word='^$query |
	htmlfmt -l 1000 |
	tr -s 'à-ÿÀ-ß' 'а-яА-Я'


             reply	other threads:[~2003-11-06 23:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-06 23:29 mirtchov [this message]
2003-11-06 23:57 ` Latchesar Ionkov
2003-11-07  0:08   ` mirtchov
2003-11-07  2:03     ` Dan Cross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6e08851011f045080e1945623fb62232@plan9.ucalgary.ca \
    --to=mirtchov@cpsc.ucalgary.ca \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).