- From: Matthew Smith <matt@kbc.net.au>
- Date: Thu, 17 Jun 2004 16:01:48 +0930
- To: WAI Interest Group <w3c-wai-ig@w3.org>
Hi All I have just written (for my own use), a small command-line Perl programme that can maintain a database of abbreviations and their definitions and substitute them into files. This may be helpful for anyone who has a lot of HTML without expanded abbreviations that needs correcting. Two types of conversion may be applied, HTML and text. Due to much tiresome debate in the past and the fact that acronyms ARE abbreviations, as far as I am concerned (and this programme), ALL contractions are rendered as <abbr> in HTML mode. In text mode, the definition is given, followed by the abbreviation in parentheses. Abbreviations are loaded from a text file containing abbreviation/definition pairs separated by a hash #. If anyone thinks they would find this useful, you are more than welcome to use this code. Standard disclaimers apply... The code may be picked up at: <http://www.tivis.net.au/tools/abbr.txt> I had to re-name from .pl to .txt otherwise Apache would execute the code rather than displaying it. I have made use of this quirk to provide an online help page (text/plain): <http://www.tivis.net.au/tools/abbr.pl> Notes: 1) I have yet to get around to doing much "user-proofing", such as raising errors when mutually exclusive arguments are given, but it's good enough for me. 2) This is NOT efficient code - with huge files and abbreviation lists, this could be slow on older machines. 3) Currently uses Berkeley DB - I may be persuaded to do a CGI/MySQL version for intranet/workgroup use. Hope this can help someone - any queries, let me know. Cheers M -- Matthew Smith Kadina Business Consultancy South Australia
Received on Thursday, 17 June 2004 02:33:46 UTC