ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Ivan Adzhubey <iadzhubey@rics.bwh.harvard.edu>
To: ALT Linux Sisyphus discussion list <sisyphus@altlinux.ru>
Subject: Re: [sisyphus] countable nouns
Date: Mon, 25 Jul 2005 12:59:54 -0400
Message-ID: <200507251259.54147.iadzhubey@rics.bwh.harvard.edu> (raw)
In-Reply-To: <42E1591F.8030201@altlinux.org>

On Friday 22 July 2005 04:37 pm, Alexey Rusakov wrote:
> Alexey Tourbin wrote:
> >Как правильно (по-английски) считать существительные?
> >
> >$ count()
> >function> {
> >function>         local n="$1"; shift
> >function>         local noun="$1"; shift
> >function>         local plural=
> >function>         [ "$n" -gt 1 ] && plural=s
> >function>         echo "$n $noun$plural"
> >function> }
> >$ count 1 package
> >1 package
> >$ count 2 package
> >2 packages
> >$ count 3 dependency
> >3 dependencys
> >$
> >
> >(Последнее неверно -- пишется dependencies.)
> >Есть для этого какая-нибудь стандартная программа?
> >
> >PS: робот! Робот хочет стать грамотным. :)
>
> Про стандартную программу не слышал. Лично я бы в такой ситуации
> использовал ngettext. Это немного другое и оно плохо масштабируется на
> весь великий и могучий английский, зато переносимость на другие языки и
> надёжность склонения на высоте.

Ну почему же нет. Есть куча модулей на Perl, которые этим занимаются. С 
переменным успехом. Все-таки живой язык полностью запрограмировать 
невозможно. Ну и потом это все для английского только. См. на CPAN в районе 
Lingua, например, Lingua::EN::Inflect - это кажется как раз то, что вам 
нужно.

-- 
Иван

  reply	other threads:[~2005-07-25 16:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-22 18:38 Alexey Tourbin
2005-07-22 19:01 ` [sisyphus] " Sergey V Turchin
2005-07-22 21:48   ` Alexey Tourbin
2005-07-25  8:11     ` Mikhail Yakshin
2005-07-25 16:18       ` Alexey Tourbin
2005-07-26  9:53         ` Mikhail Yakshin
2005-07-26 14:38           ` [sisyphus] [JT] " Michael Shigorin
2005-07-22 20:37 ` [sisyphus] " Alexey Rusakov
2005-07-25 16:59   ` Ivan Adzhubey [this message]
2005-07-23 15:33 ` Alexey Voinov

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=200507251259.54147.iadzhubey@rics.bwh.harvard.edu \
    --to=iadzhubey@rics.bwh.harvard.edu \
    --cc=sisyphus@altlinux.ru \
    /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

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git