From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/46987 Path: news.gmane.org!not-for-mail From: "Thomas A. Schmitz" Newsgroups: gmane.comp.tex.context Subject: lua questions Date: Thu, 22 Jan 2009 22:24:28 +0100 Message-ID: <8FF223F7-EFDC-43BD-8765-CBB15A03DBAD@uni-bonn.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1232659712 20189 80.91.229.12 (22 Jan 2009 21:28:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Jan 2009 21:28:32 +0000 (UTC) To: mailing ConTeXt users list for Original-X-From: ntg-context-bounces@ntg.nl Thu Jan 22 22:29:44 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1LQ77K-0003aO-Kq for gctc-ntg-context-518@m.gmane.org; Thu, 22 Jan 2009 22:29:38 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B4FC61FE8D; Thu, 22 Jan 2009 22:28:18 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 02824-03-3; Thu, 22 Jan 2009 22:27:08 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2C6721FE55; Thu, 22 Jan 2009 22:27:08 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 886681FE0B for ; Thu, 22 Jan 2009 22:27:06 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 09277-01 for ; Thu, 22 Jan 2009 22:26:17 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by ronja.ntg.nl (Postfix) with ESMTP id 31AF31FE55 for ; Thu, 22 Jan 2009 22:24:37 +0100 (CET) Original-Received: from mailout09.t-online.de (mailout09.t-online.de [194.25.134.84]) by filter2-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n0MLOWoj002038 for ; Thu, 22 Jan 2009 22:24:32 +0100 Original-Received: from fwd08.aul.t-online.de by mailout09.sul.t-online.de with smtp id 1LQ72O-0006iJ-01; Thu, 22 Jan 2009 22:24:32 +0100 Original-Received: from [192.168.0.2] (SrOpNrZ6ohgsCpgaEyxaPX1oxu-X4MDpWub-5d9B0srAK+SmuJdWLF3uy+lZ2qQQ3Z@[87.178.77.140]) by fwd08.aul.t-online.de with esmtp id 1LQ72K-1eyoa00; Thu, 22 Jan 2009 22:24:28 +0100 X-Mailer: Apple Mail (2.930.3) X-ID: SrOpNrZ6ohgsCpgaEyxaPX1oxu-X4MDpWub-5d9B0srAK+SmuJdWLF3uy+lZ2qQQ3Z@t-dialin.net X-TOI-MSGID: c1ba52d9-9714-418a-a731-1131296028d3 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=194.25.134.84; country=DE; region=05; city=Weiterstadt; latitude=49.9078; longitude=8.5953; http://maps.google.com/maps?q=49.9078,8.5953&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 169368739 - c2137f78dddf X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:46987 Archived-At: Hi all, this is a bit OT and should probably go to a lua list, but since some = people here are very proficient in lua and I feel less embarrassed = about noob questions here... I have a half-functioning python script = to convert entries from a classics database into the bibtex format. I = want to rewrite it in lua and make it more functional. Three little = problems/questions: 1. I found a script to convert Roman numerals via lpeg here: http://lua-use= rs.org/wiki/LpegRecipes = but it uses the syntax lpeg.Ca which my lpeg doesn't recognize and = which I can't find in the lpeg manual. According to a talk by Roberto = Ierusalimschy, "lpeg.Ca(patt) - "accumulates" the nested captures." (http:/= /www.inf.puc-rio.br/~roberto/lpeg/slides-lpeg-workshop2008.pdf = ) Is this obsolete, has it been replaced by anything? 2. How can I check if a string begins with a class of words "(Der |Die = |Das |The |An )" etc. and strip these words from the string? I do it = with a compiled regexp in python, but "Programming in lua" has this to = say: "Unlike some other systems, in Lua a modifier can only be applied = to a character class; there is no way to group patterns under a = modifier. For instance, there is no pattern that matches an optional = word (unless the word has only one letter). Usually you can circumvent = this limitation using some of the advanced techniques that we will see = later." I haven't found these techniques yet. 3. How can I compare strings with utf8 characters? My naive approach if string.find(record, "R=E9sum=E9") doesn't appear to work (while the same method does work if the string = has only ASCII characters). Sorry if this is OT, and I'll be grateful for any pointers. Thomas ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________