9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] An interface to a www russian-english dictionary
@ 2007-03-20 13:57 Tomasz Sobieszek
  0 siblings, 0 replies; only message in thread
From: Tomasz Sobieszek @ 2007-03-20 13:57 UTC (permalink / raw)
  To: 9fans

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 725 bytes --]

I needed a russian-english dictionary. Having found one at www.rambler.ru,
here's what I did to make using it bearable.

	A /bin/rudict script:
#!/bin/rc
query=`{ascii -8 `{echo $1 | tcs -t cp1251} | sed 's/^/%/g' | tr -d \x0a | sed 's/.$//'}
hget 'http://www.rambler.ru/dict/scripts/go.cgi?query='   ^   $query   ^   '&where=ruen' \
| tcs -f cp1251  \
| htmlfmt -c utf8 \
| sed -n '/^1.*/,/О словаре/p' \
| sed '/Полностью...|О словаре/d'

	A plumbing rule:
# Russian text
type is text
data matches '[a-zA-Z¡-￿]+'
data matches '[Ё-ё]+'
plumb start show rudict $0

	Where /bin/show is:
#!/bin/rc
$1 $2 | plumb -i -d edit -a 'action=showdata filename='/$1/$2


Tomek



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-20 13:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-20 13:57 [9fans] An interface to a www russian-english dictionary Tomasz Sobieszek

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).