Hi David,
here's a kludgy solution:
the file command seems to recognise different languages (kind of):
hoth ~ ... cat english.txt
the 'file' command recognises loadsa languages !
hoth ~ ... cat french.txt
La commande 'de fichier' reconnaît des langues loadsa!
hoth ~ ... file english.txt
english.txt: English text
hoth ~ ... file french.txt
french.txt: International language text
I dunno where it get's its language recognition from, it's not linked
against any fancy international libs - must be in glibc.
Anyways, given the above, you could use the following:
if `file "$filename"|grep 'International language'` >/dev/null 2>&1
then
aspell_opts="$aspell_opts -d french"
fi
aspell $aspell_opts -c "$filename"
I'm sure file must be more useful than that, via magic(5) or glibc
internationalization (il8n ?) or whatever, but that's going beyond
my manpage-reading abilities ;)
Hope that helps a bit,
-kev
On Pungenday, the 63rd day of Chaos, Eoin Phillips gurgled:
> On Mon, Mar 04, 2002 at 02:37:44PM +0100, David Neary wrote:
> > And finally is it possible to get aspell to recognise the
> > language that a file is written in, and to get it to load the
> > appropriate language automagically? If not, how can I specify at
> > run-time the language to check with?
>> Don't know about recognising languages automatically, but the -d switch
> specifies which dictionary is used e.g.
> aspell -d german -c filename.tex
>> Eoin
>> --
> Irish Linux Users' Group: ilug at linux.ie>http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
> List maintainer: listmaster at linux.ie
--
if I can shoot rabbits, I can shoot fascists
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!